forked from legeling/PromptHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.cli.config.ts
More file actions
38 lines (36 loc) · 947 Bytes
/
vite.cli.config.ts
File metadata and controls
38 lines (36 loc) · 947 Bytes
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
import path from "path";
import { builtinModules } from "module";
import { defineConfig } from "vite";
const externalModules = new Set([
...builtinModules,
...builtinModules.map((moduleName) => `node:${moduleName}`),
"node-sqlite3-wasm",
]);
export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
"@shared": path.resolve(__dirname, "src/shared"),
"@renderer": path.resolve(__dirname, "src/renderer"),
},
},
build: {
outDir: "out/cli",
emptyOutDir: false,
minify: false,
target: "node22",
lib: {
entry: path.resolve(__dirname, "src/cli/index.ts"),
formats: ["cjs"],
fileName: () => "prompthub.cjs",
},
rollupOptions: {
external: (id) =>
externalModules.has(id) ||
[...externalModules].some((item) => id.startsWith(`${item}/`)),
output: {
banner: "#!/usr/bin/env node",
},
},
},
});