-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
41 lines (40 loc) · 1.14 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import svgrPlugin from "vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), svgrPlugin()],
optimizeDeps: {
exclude: ["js-big-decimal"],
},
resolve: {
alias: {
"@": "/src",
"./runtimeConfig": "./runtimeConfig.browser",
},
},
server: {
port: 3000,
},
define: {
global: {},
},
build: {
commonjsOptions: {
include: [/node_modules/], // 번들에 포함시킬 모듈의 경로
extensions: [".js", ".cjs"], // CommonJS 모듈로 간주할 파일의 확장자
strictRequires: true, // require 구문에 해당 모듈이 없을 경우 에러 발생
transformMixedEsModules: true, // import와 require문을 함께 사용하는 경우 이를 번들에 포함시키기 위함
},
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.indexOf("node_modules") !== -1) {
const module = id.split("node_modules/").pop().split("/")[0];
return `vendor-${module}`;
}
},
},
},
},
});