增加打包配置
This commit is contained in:
parent
06d22c9a2b
commit
55663cc9d2
|
|
@ -6,3 +6,6 @@ VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 运检站管理/开发环境
|
# 运检站管理/开发环境
|
||||||
VITE_APP_BASE_API = '/dev-api'
|
VITE_APP_BASE_API = '/dev-api'
|
||||||
|
|
||||||
|
#静态资源路径(服务器目录)
|
||||||
|
VITE_APP_PUBLIC_PATH = ''
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,10 @@ VITE_APP_TITLE = 运检站管理
|
||||||
VITE_APP_ENV = 'production'
|
VITE_APP_ENV = 'production'
|
||||||
|
|
||||||
# 运检站管理/生产环境
|
# 运检站管理/生产环境
|
||||||
VITE_APP_BASE_API = '/prod-api'
|
VITE_APP_BASE_API = '/ynDigitalGadgets-prod-api'
|
||||||
|
|
||||||
|
#静态资源路径(服务器目录)
|
||||||
|
VITE_APP_PUBLIC_PATH = '/ynDigitalGadgets'
|
||||||
|
|
||||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||||
VITE_BUILD_COMPRESS = gzip
|
VITE_BUILD_COMPRESS = gzip
|
||||||
|
|
@ -194,7 +194,7 @@ export const dynamicRoutes = [
|
||||||
]
|
]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(import.meta.env.VITE_APP_PUBLIC_PATH || '/'),
|
||||||
routes: constantRoutes,
|
routes: constantRoutes,
|
||||||
scrollBehavior(to, from, savedPosition) {
|
scrollBehavior(to, from, savedPosition) {
|
||||||
if (savedPosition) {
|
if (savedPosition) {
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
:rules="rules"
|
:rules="!isDetail ? rules : {}"
|
||||||
label-width="auto"
|
|
||||||
size="large"
|
size="large"
|
||||||
|
label-width="auto"
|
||||||
:disabled="isDetail"
|
:disabled="isDetail"
|
||||||
>
|
>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import path from 'path'
|
||||||
import createVitePlugins from './vite/plugins'
|
import createVitePlugins from './vite/plugins'
|
||||||
|
|
||||||
// const baseUrl = 'http://192.168.0.133:58080' // 后端接口地址 超子
|
// const baseUrl = 'http://192.168.0.133:58080' // 后端接口地址 超子
|
||||||
// const baseUrl = 'http://localhost:58080' // 后端接口地址
|
const baseUrl = 'http://localhost:58080' // 后端接口地址
|
||||||
const baseUrl = 'http://192.168.0.60:58080' // 后端接口地址 福海
|
// const baseUrl = 'http://192.168.0.60:58080' // 后端接口地址 福海
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode, command }) => {
|
export default defineConfig(({ mode, command }) => {
|
||||||
|
|
@ -16,7 +16,7 @@ export default defineConfig(({ mode, command }) => {
|
||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||||
base: VITE_APP_ENV === 'production' ? '/' : '/',
|
base: VITE_APP_ENV === 'production' ? '/ynDigitalGadgets' : '/',
|
||||||
plugins: createVitePlugins(env, command === 'build'),
|
plugins: createVitePlugins(env, command === 'build'),
|
||||||
resolve: {
|
resolve: {
|
||||||
// https://cn.vitejs.dev/config/#resolve-alias
|
// https://cn.vitejs.dev/config/#resolve-alias
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue