forked from BibliothecaDAO/eternum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
51 lines (50 loc) · 1.4 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
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";
import svgr from "@svgr/rollup";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr({ dimensions: false, svgo: false, typescript: true }), react(), wasm(), topLevelAwait()],
resolve: {
alias: {
events: "events",
"@": path.resolve(__dirname, "./src"),
},
},
build: {
target: "esnext",
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
map: resolve(__dirname, "map/index.html"),
hex: resolve(__dirname, "hex/index.html"),
},
maxParallelFileOps: 2,
cache: false,
// external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
sourcemap: true,
manualChunks: (id) => {
if (id.includes("node_modules")) {
return "vendor";
}
},
inlineDynamicImports: false,
sourcemapIgnoreList: (relativeSourcePath) => {
const normalizedPath = path.normalize(relativeSourcePath);
return normalizedPath.includes("node_modules");
},
},
},
},
optimizeDeps: {
exclude: ["js-big-decimal"],
},
});