From 8c7fbf88ac3ae00fb5263cd9b768e91b7952e1dd 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: Sun, 14 Nov 2021 22:59:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=88=AB=E5=90=8D=E3=80=81=E5=A4=9A=E7=8E=AF=E5=A2=83=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E3=80=81=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 +++++ .env.production | 6 ++++++ .env.staging | 6 ++++++ package.json | 5 +++-- src/App.vue | 5 ----- src/components/HelloWorld.vue | 39 +++++++++++----------------------- src/store/index.ts | 7 +++--- tsconfig.json | 14 +++++++++--- vite.config.ts | 40 +++++++++++++++++++++++++++++++++-- 9 files changed, 85 insertions(+), 42 deletions(-) create mode 100644 .env.development create mode 100644 .env.production create mode 100644 .env.staging diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..3cbedc9 --- /dev/null +++ b/.env.development @@ -0,0 +1,5 @@ +# 开发环境变量 +ENV = 'development' + +# base api +VUE_APP_BASE_API = '/dev-api' diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..bb0b6af --- /dev/null +++ b/.env.production @@ -0,0 +1,6 @@ +# 生产环境变量 +ENV = 'production' + +# base api +VUE_APP_BASE_API = '/prod-api' + diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..2bf35d5 --- /dev/null +++ b/.env.staging @@ -0,0 +1,6 @@ +# 模拟环境变量 +ENV = 'staging' + +# base api +VUE_APP_BASE_API = '/stage-api' + diff --git a/package.json b/package.json index 552b0ca..1e2fedd 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "vue3-element-admin", "version": "0.0.0", "scripts": { - "dev": "vite", - "build": "vue-tsc --noEmit && vite build", + "dev": "vite serve --mode development", + "build:prod": "vue-tsc --noEmit && vite build --mode production", "serve": "vite preview" }, "dependencies": { @@ -13,6 +13,7 @@ "vuex": "^4.0.2" }, "devDependencies": { + "@types/node": "^16.11.7", "@vitejs/plugin-vue": "^1.9.3", "typescript": "^4.4.3", "vite": "^2.6.4", diff --git a/src/App.vue b/src/App.vue index 77bcfac..8fd9ce7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,3 @@ -