728x90
nuxt 에는 dotenv 설치가 되어 있기 때문에 추가 적으로 더 설치할 필요는 없다.
nuxt.config.js
require('dotenv').config();
axios: {
//baseURL: '/',
baseURL: process.env.VUE_APP_GW_URL,
},
env: {
VUE_APP_ATTACH_FILE_SERVER_URL : process.env.VUE_APP_ATTACH_FILE_SERVER_URL,
},
package.json
"scripts": {
"dev": "nuxt --dotenv .env.development",
"build": "nuxt build --dotenv .env.production",
"start": "nuxt start --dotenv .env.production",
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint": "yarn lint:js",
"test": "jest",
},
728x90
'VUE' 카테고리의 다른 글
vue vuetify (0) | 2022.12.29 |
---|---|
rm -rf node_modulesrm -rf yarn.lock 노드모듈 삭제 명령어 (0) | 2022.12.20 |
git 사용자 정보 저장 명령어 (0) | 2022.12.20 |
vue vite vuex (0) | 2022.12.10 |
react vite (0) | 2022.12.08 |