-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.dll.config.js
42 lines (39 loc) · 1.12 KB
/
webpack.dll.config.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
var path = require("path"),fs = require('fs'),webpack = require("webpack");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin; //视图分析webpack情况
var vendors = [
'react',
'react-dom',
'react-router',
'react-redux',
"redux",
];
module.exports = {
entry: {
vendor: vendors
},
output: {
path: path.resolve(__dirname,'./dll'),
filename: '[name].dll.js',
library: "[name]_[hash]"
},
plugins: [
new BundleAnalyzerPlugin({ //另外一种方式
analyzerMode: 'server',
analyzerHost: '127.0.0.1',
analyzerPort: 8889,
reportFilename: 'report.html',
defaultSizes: 'parsed',
openAnalyzer: true,
generateStatsFile: false,
statsFilename: 'stats.json',
statsOptions: null,
logLevel: 'info',
}),
new webpack.DllPlugin({
path: path.resolve(__dirname, './../dll', "manifest.json"),
name: "[name]_[hash]",
context: __dirname
})
]
};