This repository has been archived by the owner on Apr 10, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.ts
101 lines (100 loc) · 2.04 KB
/
rollup.config.ts
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import multi from "rollup-plugin-multi-input";
import { terser } from "rollup-plugin-terser";
import ts from "@rollup/plugin-typescript";
import json from "@rollup/plugin-json";
const production = process.env.NODE_ENV == "production";
export default [
{
input: [
"src/global.d.ts",
"src/**/index.ts",
"src/helpers.ts",
"src/entry-server.ts",
"src/entry-server-react.ts",
"src/entry-client.ts",
"src/entry-client-react.ts",
"src/Types.ts",
],
output: {
dir: "dist",
format: "esm",
},
plugins: [
json(),
ts({ declaration: true, rootDir: "src" }),
multi(),
production &&
terser({
keep_classnames: true,
}),
],
external: [
"bcryptjs",
"path",
"url",
"fs",
"dotenv",
"http",
"sirv",
"polka",
"vite",
"cors",
"crypto",
"@kodepandai/flydrive",
"@kodepandai/flydrive-s3",
"@kodepandai/node-input-validator",
"hash-equals",
"formidable",
"commander",
"colorette",
"process",
"child_process",
"knex",
"objection",
"pluralize",
"express-session",
"cookie",
"repl",
"util/types",
"supertest",
"react",
"react-dom/client",
"react-dom/server",
"react/jsx-runtime",
"react-helmet",
],
},
{
input: "console/lunox.ts",
output: {
file: "bin/lunox.cjs",
format: "cjs",
},
plugins: [
json(),
ts({ outDir: "bin", declaration: false, rootDir: "console" }),
production && terser(),
],
external: [
"commander",
"colorette",
"child_process",
"crypto",
"bcryptjs",
"path",
"fs",
],
},
{
input: "src/build/index.ts",
output: {
file: "dist/build/index.cjs",
format: "cjs",
},
plugins: [
ts({ outDir: "build", declaration: true, rootDir: "src/build" }),
production && terser(),
],
external: ["child_process"],
},
];