1 Star 0 Fork 0

zhong / posinda-utils-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.build.js 933 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhong 提交于 2022-04-19 16:27 . 更新工具库组织方式
const TerserPlugin = require('terser-webpack-plugin')
// 打包配置
const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
module.exports = {
mode: 'production',
devtool: 'source-map',
entry: './src/index.ts',
output: {
filename: 'utils.js',
sourceMapFilename: 'utils',
path: path.resolve(__dirname, 'dist/umd'),
library: {
root: 'psd',
amd: 'psd',
commonjs: 'psd',
},
libraryTarget: "umd",
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: true,
terserOptions: {
format: {
comments: /^\**!/i,
}
}
})
]
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
include: /src/,
},
]
},
resolve: {
extensions: ['.ts'],
},
plugins: [
new CleanWebpackPlugin(),
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/mygiteezhong/posinda-utils-js.git
git@gitee.com:mygiteezhong/posinda-utils-js.git
mygiteezhong
posinda-utils-js
posinda-utils-js
master

搜索帮助