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

chore(package): use cssnano 4 and PostCSS 6 #739

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/processCss.js
Expand Up @@ -192,11 +192,11 @@ module.exports = function processCss(inputSource, inputMap, options, callback) {
if(minimize) {
var cssnano = require("cssnano");
var minimizeOptions = assign({}, query.minimize);
["zindex", "normalizeUrl", "discardUnused", "mergeIdents", "reduceIdents", "autoprefixer"].forEach(function(name) {
["cssDeclarationSorter", "normalizeUrl"].forEach(function(name) {
Copy link
Member

Choose a reason for hiding this comment

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

cssDeclarationSorter should be safe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can enable it back when cssnano/cssnano#535 was fixed. Anyway, it is safer to start from CSSNano 3 optimization and after some tests, enable more optimizations.

if(typeof minimizeOptions[name] === "undefined")
minimizeOptions[name] = false;
});
pipeline.use(cssnano(minimizeOptions));
pipeline.use(cssnano({preset: ['default', minimizeOptions]}));
}

pipeline.process(inputSource, {
Expand Down