web-xiangsonghua/dwt-terminal/webpack-tetminal/webpack.dll.config.js
2024-12-23 15:13:57 +08:00

30 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var path = require('path');
var webpack = require('webpack');
// var UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: {
vendor: [
/** 这下面配置项目中用到的NPM依赖 **/
'jquery',
'rxjs',
]
},
output: {
path: path.join(__dirname, 'build', 'dev'), // 生成的dll.js路径我是存在/build/dev中
filename: '[name].dll.js', // 生成的文件名字
library: '[name]_library' // 生成文件的一些映射关系与下面DllPlugin中配置对应
},
plugins: [
// 使用DllPlugin插件编译上面配置的NPM包
new webpack.DllPlugin({
// 会生成一个json文件里面是关于dll.js的一些配置信息
path: path.join(__dirname, 'build', 'dev', '[name]-manifest.json'),
name: '[name]_library' // 与上面output中配置对应
}),
],
optimization: {
// minimizer: [new webpack.optimize.UglifyJsPlugin()]
}
};