feat(build): minify/optimize component stylesheets#4259
Conversation
| new webpack.DefinePlugin({ | ||
| 'process.env.NODE_ENV': JSON.stringify('production') | ||
| }), | ||
| new webpack.LoaderOptionsPlugin({ minimize: true }), |
There was a problem hiding this comment.
I think in general this is still needed, because it signals all loaders to minimize.
So we do it for JS via uglifyjs, and for CSS via cssnano, but I assume (haven't tested) that the some of the other loaders (file/url loader perhaps) are also affected?
@theLarkin do you know?
There was a problem hiding this comment.
Of the loaders currently used only css-loader, less-loader, and sass-loader use the minimize setting. The last two use the setting to turn on internal minification, which isn't need if cssnano is used (or css-loader with minimize enabled).
less.js also deprecated the underlying compress option that the less-loader is using via the minimize setting.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The direct use of
postcss-discard-commentsis removed ascssnanoprovides the same functionality.Also,
css-loader's internal usage ofcssnanois disabled.