Skip to content
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

feat(build): minify/optimize component stylesheets #4259

Merged
merged 1 commit into from Jan 30, 2017
Merged

feat(build): minify/optimize component stylesheets #4259

merged 1 commit into from Jan 30, 2017

Conversation

clydin
Copy link
Member

@clydin clydin commented Jan 28, 2017

The direct use of postcss-discard-comments is removed as cssnano provides the same functionality.
Also, css-loader's internal usage of cssnano is disabled.

@@ -13,7 +13,6 @@ export const getProdConfig = function (wco: WebpackConfigOptions) {
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new webpack.LoaderOptionsPlugin({ minimize: true }),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hansl hansl merged commit 499ef2f into angular:master Jan 30, 2017
@clydin clydin deleted the min-all-css branch January 31, 2017 16:20
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants