-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
57 lines (51 loc) · 1.68 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
49
50
51
52
53
54
55
56
57
import { fileURLToPath } from "url";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
server: {
port: 3000,
open: true,
},
define: {
"process.env": {},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
"@assets": fileURLToPath(new URL("./src/assets", import.meta.url)),
"@components": fileURLToPath(new URL("./src/components", import.meta.url)),
"@layouts": fileURLToPath(new URL("./src/layouts", import.meta.url)),
"@views": fileURLToPath(new URL("./src/views", import.meta.url)),
"@contexts": fileURLToPath(new URL("./src/contexts", import.meta.url)),
"@api": fileURLToPath(new URL("./src/api", import.meta.url)),
"@routes": fileURLToPath(new URL("./src/routes", import.meta.url)),
"@sample": fileURLToPath(new URL("./src/sample", import.meta.url)),
},
},
esbuild: {
loader: "jsx",
include: [
// Business as usual for .jsx and .tsx files
"src/**/*.jsx",
"src/**/*.tsx",
"node_modules/**/*.jsx",
"node_modules/**/*.tsx",
// Add the specific files you want to allow JSX syntax in
// "src/LocalJsxInJsComponent.js",
// "node_modules/bad-jsx-in-js-component/js/BadJSXinJS.js",
// "node_modules/bad-jsx-in-js-component/ts/BadTSXInTs.ts",
// --- OR ---
// Add these lines to allow all .js files to contain JSX
"src/**/*.js",
"node_modules/**/*.js",
// Add these lines to allow all .ts files to contain JSX
"src/**/*.ts",
"node_modules/**/*.ts",
],
exclude: [],
},
build: {
outDir: "../dist",
},
});