-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
55 lines (54 loc) · 1.2 KB
/
vite.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
import { resolve } from "node:path";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [],
build: {
lib: {
entry: resolve(__dirname, "src/index.ts"),
name: "SlashFix",
fileName: (format) => `slash-fix.${format}.js`,
formats: ["es", "umd"],
},
rollupOptions: {
external: [
"yargs",
"clipboardy",
"node:fs/promises",
"node:fs",
"fs",
"node:path",
"path",
"util",
"assert",
"url",
],
output: {
globals: {
yargs: "yargs",
clipboardy: "clipboardy",
"node:fs": "node:fs",
"node:fs/promises": "node:fs/promises",
fs: "fs",
"node:path": "node:path",
path: "path",
util: "util",
assert: "assert",
url: "url",
},
},
},
outDir: "dist",
target: "esnext",
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
optimizeDeps: {
exclude: ["yargs", "clipboardy"], // Ensure clipboardy is not optimized or bundled
},
define: {
"process.env.NODE_ENV": '"node"', // Set the environment to Node.js
},
});