diff --git a/src/builder/webpack-default.js b/src/builder/webpack-default.js index f66069df6..53b90c558 100644 --- a/src/builder/webpack-default.js +++ b/src/builder/webpack-default.js @@ -39,14 +39,7 @@ module.exports = function() { optimization: Mix.inProduction() ? { - minimizer: [ - new TerserPlugin(Config.terser), - new OptimizeCSSAssetsPlugin({ - cssProcessorPluginOptions: { - preset: ['default', Config.cssNano] - } - }) - ] + minimizer: [new TerserPlugin(Config.terser)] } : {}, diff --git a/src/components/Preprocessor.js b/src/components/Preprocessor.js index f4f63d169..1049fe369 100644 --- a/src/components/Preprocessor.js +++ b/src/components/Preprocessor.js @@ -65,6 +65,14 @@ class Preprocessor { ); } + if (Mix.inProduction()) { + plugins.push( + require('cssnano')({ + preset: ['default', Config.cssNano] + }) + ); + } + return plugins; })() }