refactor(projects): 环境文件重命名

This commit is contained in:
Soybean 2021-09-22 22:28:56 +08:00
parent fa2cc78937
commit e9db67ee12
3 changed files with 4 additions and 5 deletions

View File

@ -1 +0,0 @@
VITE_HTTP_ENV=VERCEL

View File

@ -4,10 +4,10 @@
"scripts": {
"dev": "vite",
"dev:prod": "vite --mode production",
"dev:vercel": "vite --mode vercel",
"dev:staging": "vite --mode staging",
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
"build:dev": "vue-tsc --noEmit --skipLibCheck && vite build --mode development",
"build:vercel": "vue-tsc --noEmit --skipLibCheck && vite build --mode vercel",
"build:staging": "vue-tsc --noEmit --skipLibCheck && vite build --mode staging",
"serve": "vite preview",
"lint": "eslint ./src --ext .vue,.js,jsx,.ts,tsx",
"lint:fix": "eslint --fix ./src --ext .vue,.js,jsx,.ts,tsx",

View File

@ -4,10 +4,10 @@ import { routes } from './routes';
import createRouterGuide from './permission';
/** 用于部署vercel托管服务 */
const isVercel = import.meta.env.VITE_HTTP_ENV === 'VERCEL';
const isStaging = import.meta.env.VITE_HTTP_ENV === 'STAGING';
export const router = createRouter({
history: isVercel ? createWebHashHistory() : createWebHistory(),
history: isStaging ? createWebHashHistory() : createWebHistory(),
routes
});