Search code examples
javascriptfirebasedartangular-dartfirebase-hosting

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


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.