Skip to content

Commit

Permalink
feat(postcss): support detecting env automatically if not presented
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Sep 7, 2019
1 parent da7daf2 commit bfb5c70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/postcss-config/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = ctx => {
const { NODE_ENV = 'development' } = process.env

module.exports = ({ env = NODE_ENV } = {}) => {
const config = {
plugins: [
require('postcss-preset-env'),
Expand All @@ -8,7 +10,7 @@ module.exports = ctx => {
],
}

if (ctx.env === 'production') {
if (env === 'production') {
config.plugins.push(
require('cssnano', {
preset: [
Expand Down

0 comments on commit bfb5c70

Please sign in to comment.