如何使pub构建在dart聚合物项目上使用源映射 [英] How make pub build to use source maps on dart polymer projects

查看:110
本文介绍了如何使pub构建在dart聚合物项目上使用源映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行调试 dart polymer项目 www.dartlang.org/tools/pub/cmd/pub-build.htmlrel =nofollow> pub build 如下:



pub build --mode debug



构建过程使用源地图用于飞镖代码。



但是,生成的html文件仍然引用.dart引导脚本。



我可以总是手动修改html后使用.js文件,但这是一个痛苦。 p>

如何让pub build自动生成引用debug javascript的html文件?

解决方案

一个解决方案是在pubspec文件中为聚合物变换器添加 js:true 条目。



例如

  transformers:
- polymer:
entry_points: web / polymer_example.html
js:true


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?

解决方案

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

这篇关于如何使pub构建在dart聚合物项目上使用源映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆