Always run webpack in production mode. (#595)

Otherwise horribly inefficent code that evals(!) strings of code is generated.
This commit is contained in:
Rouven Weßling 2018-11-12 03:53:43 +01:00 committed by Zeno Rocha
parent b57e6d019f
commit adc669df06
4 changed files with 870 additions and 87 deletions

950
dist/clipboard.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -37,8 +37,8 @@
},
"scripts": {
"build": "npm run build-debug && npm run build-min",
"build-debug": "webpack --mode=development",
"build-min": "cross-env NODE_ENV=production webpack --mode=production",
"build-debug": "webpack",
"build-min": "cross-env NODE_ENV=production webpack",
"build-watch": "webpack --watch",
"test": "karma start --single-run",
"prepublish": "npm run build"

View File

@ -12,6 +12,7 @@ Licensed MIT © Zeno Rocha`;
module.exports = {
entry: './src/clipboard.js',
mode: 'production',
output: {
filename: production ? 'clipboard.min.js' : 'clipboard.js',
path: path.resolve(__dirname, 'dist'),
@ -24,6 +25,7 @@ module.exports = {
]
},
optimization: {
minimize: production,
minimizer: [
new UglifyJSPlugin({
parallel: require('os').cpus().length,