-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dll.js
41 lines (39 loc) · 1.13 KB
/
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
const webpackContant = require('./webpack.constant');
const path = require('path');
const webpack = require('webpack');
const DllPlugin = webpack.DllPlugin;
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
/**
* VENDORS: 类库提供者
*/
const VENDORS = [
// 'jquery/dist/jquery.slim.min.js', //去除了ajax模块
'jquery/dist/jquery.min.js',
'tslib', //typescript的辅助库,会自动使用tslib.es6.js
// 'tslib/tslib.js' //兼容低版本浏览器
];
module.exports = {
entry: {
vendor: VENDORS
},
output: {
path: path.join(__dirname, webpackContant.SrcPublicJsPath, 'webpack-dll'),
filename: '[name].dll.js',
library: '[name]_library'
},
plugins: [
new DllPlugin({
path: path.join(__dirname, webpackContant.SrcPublicJsPath, 'webpack-dll', '[name]-manifest.json'),
name: '[name]_library'
}),
new UglifyJsPlugin({
compress: {
warnings: true,
drop_console: true,
unsafe: true
},
comments: false,
beautify: false
})
]
}