Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Web Build Firebase Hosting with command line parameters #7829

Open
sangaritta opened this issue Oct 13, 2024 · 1 comment
Open

Flutter Web Build Firebase Hosting with command line parameters #7829

sangaritta opened this issue Oct 13, 2024 · 1 comment

Comments

@sangaritta
Copy link

It would be great if you can pass parameters to the flutter build command because I would like to change the render of my app from CanvasKit to HTML

@aalej
Copy link
Contributor

aalej commented Oct 14, 2024

Hey @sangaritta, thanks for the feedback. Currently, since the Firebase CLI does not support passing build arguments, to workaround this you could try changing "source": "." to "public": "build/web" in your firebase.json file. This will tell the Firebase CLI to use the build in build/web.

Also, you can specify hosting.predeploy in your firebase.json to run flutter build web --web-renderer html. This will tell the Firebase CLI to build your app before deployments.

Your firebase.json file would look something like:

{
  "hosting": {
    "public": "build/web",
    "predeploy": "flutter build web --web-renderer html",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
  }
}

For those who also find this feature valuable, please leave a thumbs up on the original post. This helps us better track requests and prioritize development efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants