-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
38 lines (36 loc) · 1.28 KB
/
vite.config.ts
File metadata and controls
38 lines (36 loc) · 1.28 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
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import svgr from "vite-plugin-svgr";
import path from "node:path";
import { fileURLToPath } from "node:url";
const dirname =
typeof __dirname !== "undefined"
? __dirname
: path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [
react(),
vanillaExtractPlugin(),
svgr({
svgrOptions: {
ref: true, // JavaScript로 SVG 직접 접근 가능(useRef 등)
svgo: false, // 원본 SVG 파일을 그대로 import, 최적화 비활성화(원본 유지)
titleProp: true, // SVG에 <Logo title="" />와 같이 title 추가 가능(접근성 증대)
},
}),
],
resolve: {
alias: {
"@": path.resolve(dirname, "./src"),
"@shared": path.resolve(dirname, "./src/shared"),
"@pages": path.resolve(dirname, "./src/pages"),
"@routes": path.resolve(dirname, "./src/routes"),
"@svg": path.resolve(dirname, "./src/assets/svg"),
"@img": path.resolve(dirname, "./src/assets/img"),
"@styles": path.resolve(dirname, "./src/shared/styles"),
"@apis": path.resolve(dirname, "./src/apis"),
},
},
});