-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.prod.js
42 lines (41 loc) · 1.03 KB
/
webpack.prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const entry = path.resolve(__dirname, 'bundles', 'production.js');
module.exports = {
mode: 'production',
entry: {
'vue-graph': entry,
'vue-graph.min': entry
},
target: 'node',
externals: [nodeExternals({
whitelist: [ /^juijs/ ]
})],
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
optimization: {
minimizer: [
new UglifyJsPlugin({
include: /\.min\.js$/
})
]
},
module: {
rules: [{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: {
presets: [ 'env' ]
}
}]
}]
},
plugins: [
new BundleAnalyzerPlugin()
]
}