Rehan
Rehan

Reputation: 181

How to specify build arguments for 'firebase deploy' command used for hosting

I am using firebase hosting to host my flutter web app. Everytime I run firebase deploy or flutter deploy --only hosting, it builds the web app using flutter build web. How to give arguments to flutter build web here.

While deploying, I want to build my app with these arguments : flutter build web --web-renderer html --release to solve network image error.

OR

Is there any way I can tell firebase deploy to stop running flutter build web and just use existing build which I created using the arguments of my choice.

Upvotes: 4

Views: 762

Answers (1)

Douglas Bett
Douglas Bett

Reputation: 137

Without using firebase experimental support for Flutter in the latest versions of firebase-cli, we used to run

flutter build web --renderer canvaskit

Then in firebase.json file, specify the directory where your HTML files are located using public json key.

I'm looking for a way to specify the --renderer param in the firebase deploy command.

{
  "hosting": {
    "public": "build/web",
    "site": "site-name",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

Upvotes: 1

Related Questions