-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
48 lines (47 loc) · 1.14 KB
/
vite.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
import { resolve } from "path";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import { defineConfig } from "vite";
//TODO: push this change and depend on it in overlay
import react from "/Users/josephprice/dev/vite-plugin-react-swc/src/index.ts";
export default defineConfig({
server: {
watch: {
ignored: [
"**/_build/**",
"**/**/*.re",
"!**/_build/default/ui/js/main/**/*.js",
],
},
},
build: {
manifest: true,
output: {
app: "app.js",
},
rollupOptions: {
input: {
app: resolve(__dirname, "_build/default/ui/js/main/ui/js/main.js"),
styles: resolve(__dirname, "ui/input.css"),
},
},
outDir: "static",
},
plugins: [
nodeResolve(),
react({
include: /\.js$/,
}),
{
plugin: "vite:hmr-logger",
handleHotUpdate({ file, server }) {
if (file.endsWith(".processes/server-start.txt")) {
console.log("full page reload", file);
server.ws.send({ type: "full-reload" });
return [];
} else {
console.log("file changed", file);
}
},
},
],
});