-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathvite.config.mts
More file actions
58 lines (58 loc) · 1.24 KB
/
Copy pathvite.config.mts
File metadata and controls
58 lines (58 loc) · 1.24 KB
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
58
import {defineConfig, transformWithEsbuild} from "vite";
import react from "@vitejs/plugin-react";
import macrosPlugin from "vite-plugin-babel-macros";
import tsconfigPaths from "vite-tsconfig-paths";
import svgrPlugin from "vite-plugin-svgr";
import commonjs from "vite-plugin-commonjs";
// https://vitejs.dev/config/
export default defineConfig({
base: "/",
esbuild: {
jsxFactory: "jsx",
jsxInject: `import { jsx } from '@emotion/react'`,
},
plugins: [
macrosPlugin(),
react({
jsxRuntime: "classic",
jsxImportSource: "@emotion/react",
babel: {
plugins: ["@emotion/babel-plugin"],
},
}),
tsconfigPaths(),
svgrPlugin(),
commonjs(),
],
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler", // or "modern"
},
},
},
test: {
globals: true,
environment: "happy-dom",
},
build: {
outDir: "build",
emptyOutDir: true,
assetsInlineLimit: 0,
},
server: {
port: 3000,
proxy: {
"/assets": "http://localhost:3001",
"^/(export|import).*": "http://localhost:3001",
"/upload": "http://localhost:3001",
},
},
optimizeDeps: {
esbuildOptions: {
loader: {
".js": "jsx",
},
},
},
});