how to deploy dart web app with dart packages?
At the moment, you need to deploy the packages
folders, along with your code. Dartium doesn't use the pubspec.yaml
Currently in progress, there is a dart2dart
tool, which does a similar thing to dart2js
- tree shaking, minification, and bringing all the code into a single deployable source file. See this dartbug issue for instruction and this recent discussion on google groups.
This will likely form part of the pub deploy
scenario, which will be used to package your app for deployment on a web server.
See also: what could be a deployment strategy with pubspec on dart and: Creating a Javascript deployment set from Dart2js output
Update: Dartbug 6006 is being worked on at the moment, and says that it work like the following:
It'll copy everything in "web" into a deploy directory, run dart2dart and dart2js on all the entrypoints, and clean up the Dart source files. This will produce a directory that can be served without any additional steps.
Use:
$ pub build [--no-minify]
Use
pub build
when you’re ready to deploy your web app. When you runpub build
, it generates the assets for the current package and all of its dependencies, putting them into a new directory named build.
From a Seth Ladd's post on Google+ (no longer available).
Personally I've been using rsync since its simple and fast
cd web
rsync -RLr . ../../deploy/