I written a website using dart and polymer, it runs well in Chromium, but cannot get it compiled to js.
The directory layout is like:
my_proj/
pubspec.yaml (Contents below)
lib/
some_code.dart ... (Used by index.dart, app.dart and custom_elem_x.dart)
asset/
3rd-party codes ... (CSS, JS lib, etc.)
web/
index.html (Traditional HTML, no polymer stuff)
app.html (Use lots of custom elements written in polymer)
script/
index.dart (Pure dart, nothing fancy, has a main())
app.dart (Has a main(), in which initPolymer() get called)
polymer/
custom_elem_1.html (Imported by app.html via \
custom_elem_1.dart <link rel="import" href="polymer/custom_elem_1.html">)
...
custom_elem_n.html
custom_elem_n.dart
pubspec.yaml:
name: blah
dependencies:
browser: any
polymer: any
...
transformers:
- polymer:
entry_points: web/app.html
- $dart2js:
minify: true
If I run pub build
under my_proj/
, there is no error as far as I can tell, (lots of warnings, though). But the index.html is static (just contents, no actions), and the custom element in app.html is not rendering. Any idea what caused this?
I am using dart-sdk 1.2.1 (pub --version) on Debian 7 32bit.
Thanks.
Edit
Managed to fix it by deleting all packages/
in project dir, and running pub get
again. custom_element, shadow_dom, html5lib get updated to 0.9.2, seems these updates got it fixed, because I put get
several times before, and nothing worked.