-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
45 lines (43 loc) · 1.19 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
import {defineConfig, loadEnv} from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
// https://vitejs.dev/config/
//@ts-ignore
export default defineConfig(() => {
// Load env file based on `mode` in the current working directory.
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
const env = loadEnv("development", process.cwd(), "");
return {
// vite config
plugins: [react({fastRefresh: false})],
worker: {
plugins: [react({fastRefresh: false})],
},
server: {
port: env.PORT, // set port
},
esbuild: {
jsxFactory: "React.createElement",
jsxFragment: "React.Fragment",
},
resolve: {
alias: {
"~": path.resolve(__dirname, "./src"),
"@assets": path.resolve(__dirname, "./src/assets"),
"@BimModel": path.resolve(__dirname, "./src/BimModel"),
"@components": path.resolve(__dirname, "./src/components"),
},
},
base: "./",
build: {
outDir: "dist",
},
test: {
global: true,
includeSource: ["src/**/*.{js,ts}"],
environment: "jsdom",
setupFiles: "./src/test/setup.ts",
CSS: true,
},
};
});