Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/processCss.js
Original file line number Diff line number Diff line change
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
Loading