forked from LubinPark/react-redux-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dll.config.js
executable file
·41 lines (40 loc) · 1.16 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
"use strict";
let path = require('path');
let webpack = require('webpack');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
module.exports = {
entry: {
vendor: ['react', 'react-dom','react-router','react-redux']
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].dll.js',
/**
* output.library
* 将会定义为window.${output.library}
* 在这次的例子中,将会定义为'window.vendor_library',
*/
library: '[name]_library'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(ENV)
}
}),
new webpack.DllPlugin({
/**
* path
* 定义manifest 文件生成的位置
* [name]的部分由entry的名字替换
*/
path: path.join(__dirname,'dist','[name]-manifest.json'),
/**
* name
* dll bundle 输出到那个全局变量上
* 和 output.library 一样即可
*/
name: '[name]_library'
})
]
};