mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Migrates to Webpack 4
This commit is contained in:

committed by
Zeno Rocha

parent
3382ea3d14
commit
5ef3f1a817
@ -1,6 +1,8 @@
|
||||
const pkg = require('./package.json');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
|
||||
const production = process.env.NODE_ENV === 'production' || false;
|
||||
|
||||
@ -22,20 +24,27 @@ module.exports = {
|
||||
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}
|
||||
]
|
||||
},
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJSPlugin({
|
||||
parallel: require('os').cpus().length,
|
||||
uglifyOptions: {
|
||||
ie8: false,
|
||||
keep_fnames: false,
|
||||
output: {
|
||||
beautify: false,
|
||||
comments: false
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
plugins: production ? [
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
beautify: false,
|
||||
mangle: {
|
||||
screw_ie8: true,
|
||||
keep_fnames: true
|
||||
},
|
||||
compress: {
|
||||
screw_ie8: true
|
||||
},
|
||||
comments: false
|
||||
}),
|
||||
new webpack.BannerPlugin({banner})
|
||||
new webpack.BannerPlugin({ banner }),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: process.env.ANALYZE_BUILD ? 'server' : 'disabled'
|
||||
})
|
||||
] : [
|
||||
new webpack.BannerPlugin({banner})
|
||||
new webpack.BannerPlugin({ banner })
|
||||
]
|
||||
};
|
||||
|
Reference in New Issue
Block a user