Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Commit

Permalink
cssnano: safe by default, allow config in vue.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 10, 2016
1 parent 8b1d51b commit 45c4a50
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/style-rewriter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var postcss = require('postcss')
var selectorParser = require('postcss-selector-parser')
var cache = require('lru-cache')(100)
var assign = require('object-assign')
var options = require('./compilers/options')

var currentId
Expand Down Expand Up @@ -58,9 +59,10 @@ module.exports = function (id, css, scoped) {
}
// minification
if (process.env.NODE_ENV === 'production') {
plugins.push(require('cssnano')({
autoprefixer: false
}))
plugins.push(require('cssnano')(assign({
autoprefixer: false,
safe: true
}, options.cssnano)))
}
currentId = id
return postcss(plugins)
Expand Down

0 comments on commit 45c4a50

Please sign in to comment.