1 Star 0 Fork 0

zpp/bayread-bridge

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
“zhaopanpan” 提交于 2023-10-18 15:11 . first commit
const path = require('path')
// const webpack = require('webpack')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
module.exports = {
mode: 'production',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bayread-bridge.js',
libraryTarget: 'umd',
libraryExport: 'default',
library: 'bayread-bridge',
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: ['babel-loader'],
},
],
},
resolve: {
extensions: ['.js', '.json'],
},
devtool: 'source-map',
target: 'web',
optimization: {
minimizer: [
// 压缩JS
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_debugger: true, // 去除debugger
drop_console: true, // 去除console.log
},
warnings: false,
},
cache: true, // 开启缓存
parallel: true, // 平行压缩
}),
],
},
plugins: [new CleanWebpackPlugin()],
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zplucas/bayread-bridge.git
git@gitee.com:zplucas/bayread-bridge.git
zplucas
bayread-bridge
bayread-bridge
master

搜索帮助