From 8f1a7c7a6190e3f481780ba292eb82bd47bda3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E6=9D=A5=E6=8A=80=E6=9C=AF?= <1490493387@qq.com> Date: Fri, 19 Nov 2021 23:57:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0NODE=5FENV?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + .env.production | 2 ++ .env.staging | 2 ++ src/env.d.ts | 1 + 4 files changed, 6 insertions(+) diff --git a/.env.development b/.env.development index ee6c1c96..7bebb92e 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,7 @@ # 开发环境变量 # 变量必须以 VITE_ 为前缀才能暴露给外部读取 +NODE_ENV='development' VITE_APP_TITLE = '管理系统' VITE_APP_PORT = 3000 diff --git a/.env.production b/.env.production index 89e04cae..56a5a099 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,6 @@ # 生产环境变量 +NODE_ENV='production' + VITE_APP_TITLE = '管理系统' VITE_APP_PORT = 3000 VITE_APP_BASE_API = '/prod-api' diff --git a/.env.staging b/.env.staging index da543f6a..31bbdc9a 100644 --- a/.env.staging +++ b/.env.staging @@ -1,4 +1,6 @@ # 模拟环境变量 +NODE_ENV='staging' + VITE_APP_TITLE = '管理系统' VITE_APP_PORT = 3000 VITE_APP_BASE_API = '/stage-api' diff --git a/src/env.d.ts b/src/env.d.ts index e8b0bee7..faadf803 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -10,6 +10,7 @@ declare module '*.vue' { // 环境变量智能提示 interface ImportMetaEnv { + NODE_ENV:string, VITE_APP_TITLE: string, VITE_APP_PORT: string, VITE_APP_BASE_API: string