forked from jiphyeonjeon-42/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
34 lines (28 loc) Β· 1006 Bytes
/
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
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig, loadEnv } from "vite";
// eslint-disable-next-line import/no-extraneous-dependencies
import react from "@vitejs/plugin-react-swc";
/**
* REACT_APP_ μΌλ‘ μμνλ νκ²½λ³μλ₯Ό
* import.meta.env.REACT_APP_{λ³μλͺ
} μΌλ‘ μ¬μ©ν μ μμ΅λλ€.
* @see https://vitejs.dev/config/shared-options.html#envprefix
*/
export const envPrefix = "REACT_APP_";
/**
* vite νλ‘μ νΈ μ€μ νμΌ
*
* @see https://vitejs.dev/config/
*/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const port = parseInt(env.PORT, 10);
return {
/** @see https://vitejs.dev/plugins/ */
plugins: [react()],
envPrefix,
/** @see https://vitejs.dev/config/server-options.html#server-port */
server: { port, strictPort: true, host: true },
/** @see https://vitejs.dev/config/build-options.html#build-outdir */
build: { outDir: "build" },
};
});