Update cms webpack config, reduce log verbosity
This commit is contained in:
parent
3f70d0b5f0
commit
536cb945a5
3 changed files with 10 additions and 8191 deletions
8188
cms/package-lock.json
generated
8188
cms/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -10,7 +10,6 @@
|
|||
"babel-preset-react": "^6.24.1",
|
||||
"css-loader": "^0.28.7",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"uglifyjs-webpack-plugin": "^1.1.4",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-cli": "^2.1.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,13 +1,20 @@
|
|||
// This webpack config is used to compile the JS for the CMS
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const production = process.env.NODE_ENV === 'production'
|
||||
|
||||
console.log(`Building CMS in ${production ? 'production' : 'development'} mode`)
|
||||
|
||||
const productionPlugins = production ? [new UglifyJsPlugin()] : []
|
||||
const productionPlugins = production
|
||||
? [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('production')
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin()
|
||||
]
|
||||
: []
|
||||
|
||||
module.exports = {
|
||||
entry: './cms.js',
|
||||
|
|
@ -15,6 +22,7 @@ module.exports = {
|
|||
filename: 'cms.bundle.js',
|
||||
path: path.resolve(__dirname, '../public/admin/')
|
||||
},
|
||||
stats: { warnings: false, children: false },
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue