I'm learning Dart and its dependency manager pub
and am having a tough time seeing the "forest through the trees" here.
Say I want to use Polymer.dart in my project. So, in my project root, I create the following pubspec.yaml
:
name: test_dart
description: A sample web application
dependencies:
browser: any
polymer: ">=0.9.0 <0.10.0"
I then run pub get
, which goes to the pub
repo and fetches the browser
and polymer
dependencies that I've specified. It then creates a packages
directory in my project root, which now means I have a project that looks like:
MyDartProject/
pubspec.yaml
myapp.dart
packages/
browser/
...
...all the packages that ship with Polymer
Now I start coding my Dart web app (myapp.dart
), which will references various Polymer and browser
types/functions/etc. in its source code.
When I'm all done, I want to create a JavaScript file called myapp.js
.
According to the dart2js
docs, I need to run something like:
dart2js --out=myapp.js --package-root=??? myapp.dart
How do I include all the browser & polymer packages on the buildpath?