There comes a point in time where you consider your app to be production ready, and you are eager to hand it over to your clients or users. If it is a web app in the Dart world at this moment in time, this means compiling to JavaScript. Luckily, the pub tool will take care of this stage in your app's life, so that your app can be deployed successfully.
This is pretty straightforward. To prepare, you need to run and test your application in both the checked and production modes.
Run the pub build
command (see the Compiling your app to JavaScript recipe in Chapter 1, Working with Dart Tools), either from the command line or in Dart Editor. This creates the build
folder with the subfolder bin
or web
, respectively, for a command-line or web application. The build
folder contains complete deliverable files. The files generated in there can be deployed like any static content. Upload the JavaScript files together with the web pages and...