-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.dll.js
49 lines (45 loc) · 975 Bytes
/
webpack.dll.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
43
44
45
46
47
48
49
/*
* @Author: jypblue
* @Date: 2016-08-03 15:02:20
* @Last Modified by: jypblue
* @Last Modified time: 2016-08-03 17:19:06
*/
'use strict';
const path = require('path');
const webpack = require('webpack');
const srcDir = path.resolve(process.cwd(), 'src');
const nodeModPath = path.resolve(__dirname, './node_modules');
const vendors = [
'react',
'react-dom',
'react-redux',
'react-router',
'redux',
'redux-thunk',
];
const antd = [
'antd',
'isomorphic-fetch',
];
module.exports = {
output: {
path: path.join(__dirname, 'dll'),
filename: '[name].[chunkhash].js',
library: '[name]_[chunkhash]',
},
entry: {
vendor: vendors,
antd: antd
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, 'dll', '[name]-manifest.json'),
name: '[name]',
context: path.resolve(__dirname, 'dll'),
}),
],
resolve: {
root: [srcDir, nodeModPath],
modulesDirectories: ['node_modules']
}
};