Can I Use Dart Compiled JS (JavaScript) Into Firebase Hosting For Static Website

Issue

I am Trying to deploy a static website with some DART Features. Before that I want to Know that Can I Use Dart Compiled JavaScript Code In it or not.

Solution

Absolutely!

In fact, you can configure your firebase.json file to run the build for you as part of deploy.

{
  "hosting": {
    "public": "build",
    "predeploy": "rm -rf build; pub run build_runner build -o web:build --fail-on-severe --release"
  }
}

See https://github.com/dart-lang/angular/tree/master/examples/hacker_news_pwa for an example.

Answered By – Kevin Moore

Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *