forked from NebulaServices/Nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
50 lines (48 loc) · 1.31 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
import million from "million/compiler";
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { viteStaticCopy } from "vite-plugin-static-copy";
import { uvPath } from "@nebula-services/ultraviolet";
import { dynamicPath } from "@nebula-services/dynamic";
import path from "path";
const __dirname = path.resolve();
console.log(dynamicPath);
export default defineConfig({
plugins: [
viteStaticCopy({
targets: [
{
// .replace fixes weird paths on Windows
src: `${uvPath}/uv.*.js`.replace(/\\/g, "/"),
dest: "uv",
overwrite: false
},
{
// .replace fixes weird paths on Windows
src: `${dynamicPath}/dynamic.*.js`.replace(/\\/g, "/"),
dest: "dynamic",
overwrite: false
},
{
src: `${__dirname}/node_modules/localforage/dist/localforage.*.js`.replace(
/\\/g,
"/"
),
dest: "localforage",
overwrite: false
}
]
}),
million.vite({ auto: true }),
preact()
],
server: {
proxy: {
"/bare": {
target: "http://localhost:8080/",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/bare/, "")
}
}
}
});