Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc. tweaks to improve webpack performance #2994

Merged
merged 2 commits into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;