Skip to content

Commit

Permalink
Misc. tweaks to improve webpack performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Yolken committed Jun 20, 2017
1 parent 591e512 commit 245870e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
13 changes: 12 additions & 1 deletion superset/assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 245870e

Please sign in to comment.