gulp crisper breaking on JS error

131 Views Asked by At

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

There are 1 best solutions below

0
On

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.