Skip to content

Commit a1896ab

Browse files
committed
Update webpack mode
1 parent e7b9af2 commit a1896ab

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

cms/webpack.config.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,16 @@ const webpack = require('webpack')
44
const ExtractTextPlugin = require('extract-text-webpack-plugin')
55

66
const production = process.env.NODE_ENV === 'production'
7-
8-
console.log(`Building CMS in ${production ? 'production' : 'development'} mode`)
9-
10-
const productionPlugins = production
11-
? [
12-
new webpack.DefinePlugin({
13-
'process.env.NODE_ENV': JSON.stringify('production'),
14-
}),
15-
new webpack.optimize.UglifyJsPlugin(),
16-
]
17-
: []
7+
const mode = production ? 'production' : 'development'
8+
console.log(`Building CMS in ${mode} mode`)
189

1910
module.exports = {
2011
entry: './cms.js',
2112
output: {
2213
filename: 'cms.bundle.js',
2314
path: path.resolve(__dirname, '../public/admin/'),
2415
},
16+
mode,
2517
stats: { warnings: false, children: false },
2618
module: {
2719
rules: [
@@ -52,6 +44,5 @@ module.exports = {
5244
new ExtractTextPlugin({
5345
filename: 'cms.bundle.css',
5446
}),
55-
...productionPlugins,
5647
],
5748
}

0 commit comments

Comments
 (0)