-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safe set of minification defaults #43
Conversation
I've reviewed a few sources and tried to put a safe set of minification defaults that will not break common use cases such as some javascript and CSS use cases. I've used a subset of the "safe" options [from here](https://kangax.github.io/html-minifier/). Options not used are: - Remove redundant attributes (can break styles/JS) - Remove empty attributes (can break styles/JS) - Remove empty elements (if the empty tag is indeed unintended it should be removed from the original) - Minify URLs (seems like it should be at the users discretion to rewrite absolute URLs) This addresses a number of issues: webpack-contrib#40, webpack-contrib#38.
Any update on this? |
Ok this is getting silly, can we get some response on this? The loader needs to do the right thing by default, or people are going to consistently have problems getting started with Webpack. To make this worse since people generally only minify in production they won't even notice the problem until it reaches production. This should be being taken far more seriously than it appears to be. |
Thx for investing time on this 👍. This looks good to me, I'll try to merge and publish this asap. Just waiting for write access 😁 |
Safe set of minification defaults
Has been published as |
Does this solve webpack/webpack#752? |
Yep, I've added tests for it: 1bd81c9 |
Awesome thanks @jhnns! |
This change actually broke my layout since I depended on all whitespace being removed. Kind of strange that this pretty big change was released as a patch release. Anyway, any way to restore the old behavior and remove |
I'm sorry. You're right, this was a breaking change. You should get back the hold behavior with this config: { test: /\.html$/, loader: "html?" + JSON.stringify({ minimize: true, conservativeCollapse: false }) } |
Yep, just figured that out as well :) Thanks! |
cleaner: |
I've reviewed a few sources and tried to put a safe set of minification defaults
that will not break common use cases such as some javascript and CSS use cases.
I've used a subset of the "safe" options from here.
Options not used are:
This addresses a number of issues: #40, #38.