From 5d6be94379887c322587567459a21bea133a92c3 Mon Sep 17 00:00:00 2001 From: Jake Dexheimer Date: Tue, 3 Oct 2017 10:20:57 -0700 Subject: [PATCH] Fix compiling time (#97) --- next.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/next.config.js b/next.config.js index 3d95807..ae93d03 100644 --- a/next.config.js +++ b/next.config.js @@ -2,10 +2,11 @@ const Uglify = require('uglifyjs-webpack-plugin') module.exports = { // TODO remove `next.configs.js` when this closes: https://github.com/zeit/next.js/issues/1195 - webpack: function(c) { - c.plugins = c.plugins.filter(plugin => plugin.constructor.name !== 'UglifyJsPlugin') - - c.plugins.push(new Uglify()) + webpack: function(c, { dev }) { + if (!dev) { + c.plugins = c.plugins.filter(plugin => plugin.constructor.name !== 'UglifyJsPlugin') + c.plugins.push(new Uglify()) + } return c }