mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Misc. tweaks to improve webpack performance (#2994)
* Misc. tweaks to improve webpack performance * Fix code climate style issues
This commit is contained in:
committed by
Maxime Beauchemin
parent
9051e1f3e2
commit
de88764e93
@@ -12,7 +12,7 @@
|
||||
"cover": "babel-node node_modules/.bin/babel-istanbul cover _mocha -- --require spec/helpers/browser.js --recursive spec/**/*_spec.*",
|
||||
"dev": "NODE_ENV=dev webpack --watch --colors --progress --debug --output-pathinfo --devtool inline-source-map",
|
||||
"prod": "NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js -p --colors --progress",
|
||||
"build": "NODE_ENV=production webpack --colors --progress",
|
||||
"build": "NODE_ENV=production webpack --colors --progress &> /tmp/webpack.log",
|
||||
"lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx .",
|
||||
"sync-backend": "babel-node --presets es2015 javascripts/syncBackend.js"
|
||||
},
|
||||
|
||||
@@ -125,6 +125,17 @@ const config = {
|
||||
],
|
||||
};
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.plugins.push(new webpack.optimize.UglifyJsPlugin());
|
||||
config.plugins.push(
|
||||
// Using settings suggested in https://github.com/webpack/webpack/issues/537
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
sourceMap: false,
|
||||
minimize: true,
|
||||
compress: {
|
||||
drop_debugger: true,
|
||||
warnings: false,
|
||||
drop_console: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
module.exports = config;
|
||||
|
||||
Reference in New Issue
Block a user