We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fe6988 commit d9ba06dCopy full SHA for d9ba06d
vite.config.js
@@ -1,7 +1,14 @@
1
// vite.config.js
2
-const { defineConfig } = require('vite')
+import { defineConfig, loadEnv } from 'vite'
3
4
-module.exports = defineConfig({
5
- base: '/', // or '/<REPO>/' if deploying to a repository
6
- plugins: []
+export default defineConfig(({ command, mode }) => {
+ // 현재 작업 디렉터리의 `mode`를 기반으로 env 파일을 불러옴
+ // 세 번째 매개변수를 ''로 설정하면 `VITE_` 접두사에 관계없이 모든 환경 변수를 불러옴
7
+ const env = loadEnv(mode, process.cwd(), '')
8
+ return {
9
+ base: '//', // or '/<REPO>/' if deploying to a repository
10
+ plugins: [],
11
+ define: {
12
+ }
13
14
})
0 commit comments