cfware / babel-plugin-template-html-minifier

Minify HTML in tagged template strings using html-minifier
MIT License
63 stars 4 forks source link

Make error handling behavior configurable #34

Closed LarsDenBakker closed 5 years ago

LarsDenBakker commented 5 years ago

I'm working on https://github.com/cfware/babel-plugin-template-html-minifier/issues/30, but putting this in as a separate PR.

This makes the error handling behavior configurable, which is useful especially when dealing with CSS but also with some types of HTML and bindings in comments.

You can turn on minification and comment removal, in the case of some malformed template or css you get a notification but it doesn't crash the built. If the error is from code not under your control you can create an issue at the responsible project, but it doesn't block you from moving on.

Personally I'd say failOnError should be false by default, what do you think? It would be a breaking change, so many it's good to do that along with other breaking changes.

LarsDenBakker commented 5 years ago

Thanks for the review, I've updated the PR accordingly.