dart-archive / polymer-dart

Polymer support for Dart
https://pub.dartlang.org/packages/polymer
BSD 3-Clause "New" or "Revised" License
181 stars 33 forks source link

After `pub build` JS script tag is not added in output `index.html` #593

Closed zoechi closed 8 years ago

zoechi commented 8 years ago

After changing <script type="application/dart" src="index.bootstrap.initialize.dart"></script> for example in build/web/google_analytics/index.html to

the page works fine in Chrome.

jakemac53 commented 8 years ago

Yes, this is working as intended for now at least. You can add the <script src="packages/browser/dart.js"></script> script below your dart script and it will swap it at runtime (thats what we do in the tests) but it isn't ideal for deployment.

jakemac53 commented 8 years ago

Really there should be a separate package which does this in a general fashion, but in the meantime we could add an option to the web_components transformer to do it?

jakemac53 commented 8 years ago

fwiw there is this https://pub.dartlang.org/packages/dart_to_js_script_rewriter but I have never used it

zoechi commented 8 years ago

Ups, I forgot that browser/dart.js needs to come after the Dart script tag. Didn't do much client side Dart the recent year. dart-lang/pub#779 Thanks, and sorry for the noise.