-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.js
78 lines (76 loc) · 1.74 KB
/
tsup.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { defineConfig } from "tsup";
export default defineConfig([
// browser build
// {
// entry: {
// client: "src/httpClient.js",
// socketIoClient: "src/socketIoClient.js",
// utils: "src/utils.js",
// defs: "src/defs.js",
// models: "src/models/index.js",
// events: "src/events/index.js",
// errors: "src/errors/index.js",
// commands: "src/commands/index.js",
// useCases: "src/useCases/index.js",
// },
// outDir: "dist",
// format: ["esm", "cjs"],
// dts: true,
// clean: false,
// sourcemap: true,
// bundle: true,
// target: "es2022",
// platform: "neutral",
// globalName: "kohost",
// minify: "terser",
// terserOptions: {
// mangle: false,
// keep_fnames: true,
// keep_classnames: true,
// },
// },
// //node build
// {
// entry: ["src/index.js"],
// outDir: "dist",
// format: ["cjs", "esm"],
// dts: true,
// clean: false,
// sourcemap: true,
// target: "node20",
// platform: "node",
// globalName: "kohost",
// keepNames: true,
// },
{
entry: [
"src/index.js",
"src/models/*",
"src/useCases/*",
"src/events/*",
"src/errors/*",
"src/commands/*",
"src/defs.js",
"src/utils.js",
"src/httpClient.js",
"src/socketIoClient.js",
"src/amqpClient.js",
"src/validators.js",
],
outDir: "dist",
esbuildOptions(options) {
options.outbase = "src";
return options;
},
minify: true,
format: ["cjs", "esm"],
dts: true,
bundle: true,
clean: true,
sourcemap: true,
target: ["es2022"],
platform: "node",
globalName: "kohost",
keepNames: true,
},
]);