-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
76 lines (70 loc) · 1.71 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import * as path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgrPlugin from "vite-plugin-svgr";
import tsconfigPaths from "vite-tsconfig-paths";
import { visualizer } from "rollup-plugin-visualizer";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
tsconfigPaths(),
svgrPlugin(),
// visualizer({
// open: true,
// gzipSize: true,
// brotliSize: true,
// }),
],
css: {
modules: {
scopeBehaviour: "local",
localsConvention: "camelCase",
},
preprocessorOptions: {
scss: {
// additionalData: "$injectedColor: orange;",
},
},
},
server: {
// proxy: {
// "/api": {
// target: "http://54.180.121.206:8080",
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ""),
// },
// },
proxy: {
"/api": {
target: "http://54.180.121.206:8080",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
},
},
},
build: {
rollupOptions: {
input: {
main: path.resolve(__dirname, "index.html"),
},
},
},
// 절대경로
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
"@assets": path.resolve(__dirname, "src/assets"),
"@components": path.resolve(__dirname, "src/components"),
"@hooks": path.resolve(__dirname, "src/hooks"),
"@pages": path.resolve(__dirname, "src/pages"),
"@router": path.resolve(__dirname, "src/router"),
"@stories": path.resolve(__dirname, "src/stories"),
"@styles": path.resolve(__dirname, "src/styles"),
"@utils": path.resolve(__dirname, "src/utils"),
"@types": path.resolve(__dirname, "src/types"),
"@api": path.resolve(__dirname, "src/api"),
},
},
publicDir: "public",
});