i am using cssnano as a postcss plugin in my grunt workflow. what i want to do is divide the postcss task in two different subtasks: one for development (with autoprefixer only) and one for distribution (with autoprefixer and cssnano). i thought of creating two subtasks, and this is my configuration:
postcss: {
dev: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: 'last 2 version, IE 9'
}),
//require('cssnano')() // minify the result
]
},
dist: {
src: 'css/main.css'
}
}, //dev
build: {
options: {
map: false,
processors: [
require('autoprefixer')({
browsers: 'last 2 version, IE 9'
}),
require('cssnano')() // minify the result
]
},
dist: {
src: '../site/css/main.css'
}
}//build
}, //postcss
it looks like it's working but it actually won't apply the plugins.
what am i doing wrong? is this a syntax error? or am i on the wrong path completely?