-
-
Notifications
You must be signed in to change notification settings - Fork 205
Possibility to extend default 'minimize' options #413
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
Comments
You already can do it, you don't need to set all options, because "html-minifier-terser" do it |
https://github.com/webpack-contrib/html-loader#boolean-1 |
hm, I think we should open an issue in |
I found where defaults are set in html-loader code: https://github.com/webpack-contrib/html-loader/blob/v3.0.1/src/utils.js#L499 |
Oh, yes, by default |
@alexander-akait wouldn't it be a better experience if this were just the default behavior? Instead of users having to know to import and mix in the defaults themselves? For example, changing the following like to something like the code below? if (options.minimize) {
plugins.push(minimizerPlugin({ minimize: typeof options.minimize !== 'boolean' ? { ...defaultMinimizerOptions, ...options.minimize }: options.minimize, errors }));
} I have to admit, I thought that was already the behavior. |
Yep, it will be better, but it will be breaking change, we can add TODO for the next major release |
Feature Proposal
Make it possible to extend default 'minimize' options when defined as object, without repeating all other default options
Feature Use Case
Currently to change removeComments to false I need this snippet of code:
With this feature it could look something like this:
Or can try implementing something similar to '...' syntax here: https://webpack.js.org/plugins/mini-css-extract-plugin/#minimizing-for-production
Please paste the results of npx webpack-cli info here, and mention other relevant information
The text was updated successfully, but these errors were encountered: