gulp crisper breaking on JS error

时间:2016-03-04 03:42:14

标签: javascript vulcanize

I use vulcanize with gulp to extract js from html files when writing polymer elements. If there is an error within the js, however, vulcanize won't complete and it breaks the build process. My understanding was that vulcanize simply moved everything within script tags to a new file which could then be linted however this is showing that it isn't the case. Does anyone know a solution to this?

1 个答案:

答案 0 :(得分:0)

Vulcanize实际上不是分隔JavaScript的工具。它将为您连接的文件中提取的内联脚本,但它不会将它们移动到单独的文件中。正如我从@robdodson PolyCast视频#39和40中了解到的那样,Crisper是用于将脚本与硫化(即连接)文件分开的工具。

我仍然无法让自己工作,但我能够成功硫化我的文件,然后通过调整https://github.com/ragingwind/gulp-crisper/issues/10中@ks​​ugiarto建议的解决方案从中提取javascript。

如果在JavaScript中出现错误而没有完成硫化,如果无法解决错误,则可能有助于将'inlineScripts'设置为false。如果这有帮助,请接受这个答案,或投票。