shkuznetsov / gulp-minify-inline

gulp plugin that minifies inline JS and CSS
MIT License
28 stars 5 forks source link

Prevent </script> in JavaScript strings #6

Closed TimothyGu closed 8 years ago

TimothyGu commented 8 years ago

See also PolymerElements/polymer-starter-kit#545.

addyosmani commented 8 years ago

cc @shkuznetsov

shkuznetsov commented 8 years ago

Hello there. Without digging too deeply into the case I would vote against merging this commit. In my opinion this plugin should act as a transparent proxy in regards to options it passes down to UglifyJS, rather then trying to "enhance" them. If you think having this option there by default would be beneficial than why not to suggest that to UglifyJS maintainers?

That said, I'm not sure I understood the situation clear enough thus I am absolutely opened to the further discussion.

TimothyGu commented 8 years ago

If you think having this option there by default would be beneficial than why not to suggest that to UglifyJS maintainers?

This option is specific to the case of gulp-minify-inline: it is only beneficial in the context of inlining it in HTML. It is not applicable to the general use case of UglifyJS: minifying JavaScript files.

FWIW, html-minifier adds this option unconditionally as well.