-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathwebpack.config.js
37 lines (37 loc) · 1.04 KB
/
webpack.config.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
const path = require("path");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
module.exports = {
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_debugger: true,
drop_console: true
}
},
cache: true, // 开启缓存
parallel: true, // 允许并发
sourceMap: false // set to true if you want JS source maps
}),
]
},
entry: "./src/index.ts",
output: {
filename: "qrcode-with-logos.min.js", //contenthash 若文件内容无变化,则contenthash 名称不变
path: path.resolve(__dirname, "./lib"),
library: "QrCodeWithLogo",
libraryExport: "default",
libraryTarget: "umd"
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".json"]
},
module: {
rules: [
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
{ test: /\.tsx?$/, use: ["ts-loader"], exclude: /node_modules/ },
]
},
mode: "production"
};