How make pub build to use source maps on dart poly

2019-04-12 15:00发布

问题:

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?

回答1:

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