forked from wonderful-panda/inazuma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
30 lines (29 loc) · 867 Bytes
/
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
import path from "path";
import react from "@vitejs/plugin-react";
import jotaiDebugLabel from "jotai/babel/plugin-debug-label";
import jotaiReactRefresh from "jotai/babel/plugin-react-refresh";
import { defineConfig } from "vite";
export default defineConfig({
root: "./src/react",
base: "./",
plugins: [react({ babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] } })],
build: {
sourcemap: "inline",
outDir: "../../dist",
emptyOutDir: true,
rollupOptions: {
onwarn(warning, defaultHandler) {
if (warning.code === "SOURCEMAP_ERROR") {
return;
}
defaultHandler(warning);
}
}
},
resolve: {
alias: [
{ find: "@", replacement: path.resolve(__dirname, "./src/react") },
{ find: "@backend", replacement: path.resolve(__dirname, "./src-tauri/types/bindings") }
]
}
});