6 Star 1 Fork 1

高朋/iot_platform_web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.dll.config.js 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
高朋 提交于 2021-09-10 11:18 +08:00 . init
const path = require('path');
const DllPlugin = require('webpack/lib/DllPlugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); //js压缩
const { library } = require('./package.json');
module.exports = {
mode: 'production',
// 入口文件
entry: library,
// 输出文件
output: {
// 文件名称
filename: '[name].dll.js',
// 将输出的文件放到dist目录下
path: path.resolve(__dirname, 'lib'),
library: '_dll_[name]'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins: [
// 使用插件 DllPlugin
new DllPlugin({
name: '_dll_[name]',
/* 生成manifest文件输出的位置和文件名称 */
path: path.join(__dirname, 'lib/[name].manifest.json')
}),
],
optimization: {
minimizer: [
//js压缩
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: false,
uglifyOptions: {
warnings: false,
compress: {
drop_console: true, // console
drop_debugger: false,
pure_funcs: ['console.log'] // 移除console
}
}
}),
]
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cliffgao2s/iot_platform_web.git
git@gitee.com:cliffgao2s/iot_platform_web.git
cliffgao2s
iot_platform_web
iot_platform_web
master

搜索帮助