Skip to content

Commit

Permalink
perf(cssnano): 🔧 production use only
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Mar 10, 2022
1 parent 34ed4b3 commit c5ec91c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,18 @@ const tailwindcss = require('tailwindcss')
const cssnano = require('cssnano')

module.exports = {
plugins: [postcssImport(), tailwindcss(), postcssPresetEnv(), cssnano()]
plugins: [
postcssImport,
tailwindcss,
postcssPresetEnv,
...(process.env.NODE_ENV === 'production'
? [cssnano({
preset: [
'default',
{ discardComments: { removeAll: true } }
]
})]
: []
)
]
}

0 comments on commit c5ec91c

Please sign in to comment.