-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
46 lines (44 loc) · 1.07 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
38
39
40
41
42
43
44
45
46
const path = require("node:path");
module.exports = {
mode: "production",
entry: {
generateStrings: {
import: "./src/index.ts",
filename: "generateStrings.min.js",
},
generateRandomPassword: {
import: "./src/utils/generateRandomPassword.ts",
filename: "generateRandomPassword.min.js",
},
generateRandomString: {
import: "./src/utils/generateRandomString.ts",
filename: "generateRandomString.min.js",
},
generateRandomStringWithMask: {
import: "./src/utils/generateRandomStringWithMask.ts",
filename: "generateRandomStringWithMask.min.js",
},
},
output: {
path: path.resolve(__dirname, "dist"),
libraryTarget: "umd",
globalObject: "this",
clean: true,
},
resolve: {
modules: [path.resolve(__dirname, "src"), "node_modules"],
extensions: [".ts"],
},
module: {
rules: [
{
test: /\.(ts)$/,
exclude: /(node_modules)/,
use: {
// `.swcrc` can be used to configure swc
loader: "swc-loader",
},
},
],
},
};