mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Always run webpack in production mode. (#595)
Otherwise horribly inefficent code that evals(!) strings of code is generated.
This commit is contained in:
parent
b57e6d019f
commit
adc669df06
950
dist/clipboard.js
vendored
950
dist/clipboard.js
vendored
File diff suppressed because one or more lines are too long
1
dist/clipboard.min.js
vendored
1
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -37,8 +37,8 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build-debug && npm run build-min",
|
"build": "npm run build-debug && npm run build-min",
|
||||||
"build-debug": "webpack --mode=development",
|
"build-debug": "webpack",
|
||||||
"build-min": "cross-env NODE_ENV=production webpack --mode=production",
|
"build-min": "cross-env NODE_ENV=production webpack",
|
||||||
"build-watch": "webpack --watch",
|
"build-watch": "webpack --watch",
|
||||||
"test": "karma start --single-run",
|
"test": "karma start --single-run",
|
||||||
"prepublish": "npm run build"
|
"prepublish": "npm run build"
|
||||||
|
|
|
@ -12,6 +12,7 @@ Licensed MIT © Zeno Rocha`;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/clipboard.js',
|
entry: './src/clipboard.js',
|
||||||
|
mode: 'production',
|
||||||
output: {
|
output: {
|
||||||
filename: production ? 'clipboard.min.js' : 'clipboard.js',
|
filename: production ? 'clipboard.min.js' : 'clipboard.js',
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
@ -24,6 +25,7 @@ module.exports = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
|
minimize: production,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new UglifyJSPlugin({
|
new UglifyJSPlugin({
|
||||||
parallel: require('os').cpus().length,
|
parallel: require('os').cpus().length,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user