-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.libs.js
41 lines (36 loc) · 985 Bytes
/
webpack.libs.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
var webpack = require('webpack');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var WebpackMd5Hash = require('webpack-md5-hash');
var path = require('path');
module.exports = {
entry: {
vendors: [
'antd',
'isomorphic-fetch',
'react',
'react-dom',
'react-redux',
'react-router',
'redux',
'redux-promise-middleware',
'redux-thunk',
'superagent',
'jquery'
]
},
output: {
path: path.resolve('./libs/'),
filename: '[name]_[chunkhash].js',
library: '[name]_[chunkhash]'
},
plugins: [
new CleanWebpackPlugin(['libs']),
new webpack.DllPlugin({
path: path.resolve('./libs/[name]_manifest.json'),
name: '[name]_[chunkhash]',
context: __dirname
}),
// 根据文件内容生成 MD5
new WebpackMd5Hash()
]
};