简体   繁体   中英

gulp crisper breaking on JS error

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?

Vulcanize is not actually the tool that separates your JavaScript. It will fetch inline scripts for you that are referenced in the files you are concatenating, but it will not move them to a separate file. As I understand it from @robdodson PolyCast videos #39 and 40, Crisper is the tool that you would use to separate the scripts from the vulcanized (ie. concatenated) file.

I am still having trouble getting this to work myself, but I was able to successfully vulcanize my files and then pull the javascript from them by adapting the solution suggested by @ksugiarto in https://github.com/ragingwind/gulp-crisper/issues/10 .

As far as not finishing vulcanize if there is an error in the JavaScript, if you cannot solve the error, it may help to set the 'inlineScripts' to false. If this helps, please accept this answer, or vote it up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM