2

On a dart polymer project when I do a debug pub build like so:

pub build --mode debug

the build process does correctly produce unminified javascript with source maps for the dart code.

However, the generated html file still references the .dart bootstrap script.

I can always manually modify the html after the fact to use the .js file, but that's a pain.

How do I get pub build to automatically generate an html file that references the debug javascript?

Ed Evans
  • 178
  • 1
  • 7

1 Answers1

2

One solution is to add a js: true entry for the polymer transformer in the pubspec file.

E.g.

transformers:
- polymer:
    entry_points: web/polymer_example.html
    js: true
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Ed Evans
  • 178
  • 1
  • 7
  • Did you find some explanation about what `js: true` is for? Or is this it's entire purpuse? – Günter Zöchbauer Aug 21 '14 at 17:36
  • No, I stumbled across a usage of js: false in [a dartlang groups post](https://groups.google.com/a/dartlang.org/forum/#!msg/web-ui/jdoLc_roMLI/P1q8Cl3uBV0J). Turns out js:true works for what I need. But I'd love to have a link to the canonical set of options, with explanations. – Ed Evans Aug 21 '14 at 17:45
  • Update: The dart polymer transfomer [source](https://github.com/dart-lang/bleeding_edge/blob/master/dart/pkg/polymer/lib/transformer.dart) is a good place to see all the options. Or, in the dart editor, \packages\polymer\transformer.dart. – Ed Evans Aug 25 '14 at 12:25