Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
Lic
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
Lic
Commits
2cce373a
提交
2cce373a
authored
12月 08, 2023
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增字段 租户标识 租户域名
上级
392e301d
全部展开
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
37 行删除
+43
-37
licInformation.vue
src/views/business/licInformation.vue
+0
-0
vite.config.ts
vite.config.ts
+43
-37
没有找到文件。
src/views/business/licInformation.vue
浏览文件 @
2cce373a
差异被折叠。
点击展开。
vite.config.ts
浏览文件 @
2cce373a
import
{
defineConfig
}
from
'vite'
;
import
vue
from
'@vitejs/plugin-vue'
;
import
{
defineConfig
}
from
"vite"
;
import
vue
from
"@vitejs/plugin-vue"
;
// vite 提供的操作env配置变量的方法loadEnv
import
{
loadEnv
}
from
'vite'
;
import
{
loadEnv
}
from
"vite"
;
// nodejs写法,获取项目目录
import
path
from
'path'
;
import
path
from
"path"
;
//按需要加载
// import AutoImport from 'unplugin-auto-import/vite'
...
...
@@ -11,26 +11,26 @@ import path from 'path';
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// import Icons from 'unplugin-icons/vite'
// import IconsResolver from 'unplugin-icons/resolver'
import
Inspect
from
'vite-plugin-inspect'
import
{
viteMockServe
}
from
'vite-plugin-mock'
import
{
createSvgIconsPlugin
}
from
'vite-plugin-svg-icons'
const
pathSrc
=
path
.
resolve
(
__dirname
,
'src'
)
import
Inspect
from
"vite-plugin-inspect"
;
import
{
viteMockServe
}
from
"vite-plugin-mock"
;
import
{
createSvgIconsPlugin
}
from
"vite-plugin-svg-icons"
;
const
pathSrc
=
path
.
resolve
(
__dirname
,
"src"
);
// https://vitejs.dev/config/
export
default
({
command
,
mode
})
=>
{
const
env
=
loadEnv
(
mode
,
process
.
cwd
())
const
env
=
loadEnv
(
mode
,
process
.
cwd
());
return
defineConfig
({
plugins
:
[
vue
(),
createSvgIconsPlugin
({
// 指定需要缓存的图标文件夹
iconDirs
:
[
path
.
resolve
(
process
.
cwd
(),
'src/assets/icons'
)],
iconDirs
:
[
path
.
resolve
(
process
.
cwd
(),
"src/assets/icons"
)],
// 指定symbolId格式
symbolId
:
'icon-[dir]-[name]'
symbolId
:
"icon-[dir]-[name]"
,
}),
viteMockServe
({
// default
mockPath
:
'mock'
,
mockPath
:
"mock"
,
}),
// AutoImport({
// // Auto import functions from Vue, e.g. ref, reactive, toRef...
...
...
@@ -75,17 +75,18 @@ export default ({ command, mode }) => {
],
// 服务器配置
server
:
{
host
:
'0.0.0.0'
,
host
:
"0.0.0.0"
,
port
:
Number
(
loadEnv
(
mode
,
process
.
cwd
()).
VITE_APP_PORT
),
strictPort
:
false
,
// 端口被占用直接退出
https
:
false
,
// 默认用http方式
open
:
true
,
// 在开发服务器启动时自动在浏览器中打开应用程序
proxy
:
{
// 代理配置
open
:
true
,
// 在开发服务器启动时自动在浏览器中打开应用程序
proxy
:
{
// 代理配置
// 字符串简写写法
// '/foo': '',
// 选项写法
"/lic"
:
{
target
:
'http://192.168.0.8:8090'
target
:
"http://192.168.1.27:8090"
,
// rewrite: (path) => path.replace(/^\/api/, '')
},
// 正则表达式写法
...
...
@@ -96,13 +97,14 @@ export default ({ command, mode }) => {
// },
},
hmr
:
{
overlay
:
true
// 屏蔽服务器报错
}
overlay
:
true
,
// 屏蔽服务器报错
},
},
resolve
:
{
// 设置项目文件导入路径
resolve
:
{
// 设置项目文件导入路径
alias
:
{
'@'
:
pathSrc
}
"@"
:
pathSrc
,
},
},
css
:
{
// css预处理器
...
...
@@ -111,28 +113,33 @@ export default ({ command, mode }) => {
// 给导入的路径最后加上 ;
scss
:
{
charset
:
false
,
//防止样式出现警告,中文
additionalData
:
'@import "@/assets/styles/global.scss";'
}
}
charset
:
false
,
//防止样式出现警告,中文
additionalData
:
'@import "@/assets/styles/global.scss";'
,
},
},
build
:
{
// 分块打包配置
},
build
:
{
// 分块打包配置
chunkSizeWarningLimit
:
1500
,
// 分块打包,分解块,将大块分解成更小的块
rollupOptions
:
{
output
:
{
manualChunks
(
id
)
{
if
(
id
.
includes
(
'node_modules'
))
{
return
id
.
toString
().
split
(
'node_modules/'
)[
1
].
split
(
'/'
)[
0
].
toString
();
}
}
if
(
id
.
includes
(
"node_modules"
))
{
return
id
.
toString
()
.
split
(
"node_modules/"
)[
1
]
.
split
(
"/"
)[
0
]
.
toString
();
}
},
},
},
terserOptions
:
{
compress
:
{
drop_console
:
true
,
// 生产环境移除console
drop_debugger
:
true
// 生产环境移除debugger
}
}
}
})
}
\ No newline at end of file
drop_debugger
:
true
,
// 生产环境移除debugger
},
},
},
});
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论