mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-10-14 22:27:05 +00:00
build 打包配置优化
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.vscode/
|
4
.env
4
.env
@@ -2,13 +2,13 @@
|
||||
VITE_GLOB_APP_TITLE=DaxPay服务端
|
||||
|
||||
# 发布路径
|
||||
VITE_PUBLIC_PATH=/
|
||||
VITE_PUBLIC_PATH=/web
|
||||
|
||||
# 接口地址
|
||||
VITE_GLOB_API_URL=/server
|
||||
|
||||
# 接口前缀
|
||||
VITE_GLOB_API_URL_PREFIX =
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
||||
# 终端类型
|
||||
VITE_GLOB_APP_CLIENT=dax-pay
|
||||
|
26
.env.build
26
.env.build
@@ -1,20 +1,28 @@
|
||||
# 名称
|
||||
# 名称 不可为空
|
||||
VITE_GLOB_APP_TITLE=DaxPay服务端
|
||||
|
||||
# 压缩方式
|
||||
VITE_BUILD_COMPRESS='gzip'
|
||||
# 独立部署模式
|
||||
#VITE_PUBLIC_PATH=/
|
||||
# API 接口前缀
|
||||
#VITE_GLOB_API_URL_PREFIX=/api
|
||||
|
||||
# 发布路径
|
||||
VITE_PUBLIC_PATH=/
|
||||
# 嵌入式模式 与网关部署在一起
|
||||
VITE_PUBLIC_PATH=/web
|
||||
# API 接口前缀
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
||||
|
||||
# 是否启用gzip压缩或brotli压缩, 可选: gzip | brotli | none, 如果你需要多种形式,你可以用','来分隔
|
||||
VITE_BUILD_COMPRESS='none'
|
||||
|
||||
# 接口地址
|
||||
VITE_GLOB_API_URL=/server
|
||||
|
||||
# 接口前缀
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
VITE_GLOB_API_URL=
|
||||
|
||||
# 终端类型
|
||||
VITE_GLOB_APP_CLIENT=dax-pay
|
||||
|
||||
# 超时时间
|
||||
VITE_GLOB_API_TIMEOUT=30000
|
||||
|
||||
# 是否开启打包分析
|
||||
VITE_ENABLE_ANALYZE=false
|
||||
|
@@ -6,7 +6,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"bootstrap": "pnpm install",
|
||||
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build",
|
||||
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode build",
|
||||
"build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode analyze",
|
||||
"build:no-cache": "pnpm store prune && npm run build",
|
||||
"dev": "pnpm vite --mode admin --port=13000",
|
||||
|
@@ -4,7 +4,7 @@ import type { Router, RouteRecordNormalized } from 'vue-router'
|
||||
import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '@/router/constant'
|
||||
import { cloneDeep, omit } from 'lodash-es'
|
||||
import { warn } from '@/utils/log'
|
||||
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
||||
import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'
|
||||
import XEUtils from 'xe-utils'
|
||||
|
||||
const IFRAME = () => import('@/views/sys/iframe/FrameBlank.vue')
|
||||
@@ -141,7 +141,7 @@ function promoteRouteLevel(routeModule: AppRouteModule) {
|
||||
// createRouter 创建一个可以被 Vue 应用程序使用的路由实例
|
||||
let router: Router | null = createRouter({
|
||||
routes: [routeModule as RouteRecordRaw],
|
||||
history: createWebHashHistory(),
|
||||
history: createWebHistory(),
|
||||
})
|
||||
// getRoutes: 获取所有 路由记录的完整列表。
|
||||
const routes = router.getRoutes()
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import type { RouteRecordRaw } from 'vue-router'
|
||||
import type { App } from 'vue'
|
||||
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import {createRouter, createWebHistory} from 'vue-router'
|
||||
import { basicRoutes } from './routes'
|
||||
|
||||
// 白名单应该包含基本静态路由
|
||||
@@ -17,7 +17,7 @@ getRouteNames(basicRoutes)
|
||||
// 创建一个可以被 Vue 应用程序使用的路由实例
|
||||
export const router = createRouter({
|
||||
// 创建一个 hash 历史记录。
|
||||
history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH),
|
||||
history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH),
|
||||
// 应该添加到路由的初始路由列表。
|
||||
routes: basicRoutes as unknown as RouteRecordRaw[],
|
||||
// 是否应该禁止尾部斜杠。默认为假
|
||||
|
Reference in New Issue
Block a user