refactor(projects): 环境文件重命名
This commit is contained in:
parent
fa2cc78937
commit
e9db67ee12
@ -1 +0,0 @@
|
||||
VITE_HTTP_ENV=VERCEL
|
@ -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",
|
||||
|
@ -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
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user