Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
4cca0071
V
vue-vben-admin
项目概览
球球不吃虾
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4cca0071
编写于
12月 04, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(code-split): code split optimization
上级
81e90409
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
5 deletion
+39
-5
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
build/vite/optimizer.ts
build/vite/optimizer.ts
+20
-0
vite.config.ts
vite.config.ts
+18
-5
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
4cca0071
...
...
@@ -10,6 +10,7 @@
-
还原 antdv 默认 loading,重构
`Loading`
组件,增加
`useLoading`
和
`v-loading`
指令。并增加示例
-
i18n 支持 vscode
`i18n-ally`
插件
-
新增多级路由缓存示例
-
打包代码拆分(试验)
### ⚡ Performance Improvements
...
...
build/vite/optimizer.ts
0 → 100644
浏览文件 @
4cca0071
import
type
{
GetManualChunk
,
GetManualChunkApi
}
from
'
rollup
'
;
//
const
vendorLibs
:
{
match
:
string
[];
output
:
string
}[]
=
[
{
match
:
[
'
xlsx
'
],
output
:
'
xlsx
'
,
},
];
// @ts-ignore
export
const
configManualChunk
:
GetManualChunk
=
(
id
:
string
,
api
:
GetManualChunkApi
)
=>
{
if
(
/
[\\/]
node_modules
[\\/]
/
.
test
(
id
))
{
const
matchItem
=
vendorLibs
.
find
((
item
)
=>
{
const
reg
=
new
RegExp
(
`[\\/]node_modules[\\/]_?(
${
item
.
match
.
join
(
'
|
'
)}
)(.*)`
,
'
ig
'
);
return
reg
.
test
(
id
);
});
return
matchItem
?
matchItem
.
output
:
null
;
}
};
vite.config.ts
浏览文件 @
4cca0071
...
...
@@ -3,6 +3,7 @@ import { resolve } from 'path';
import
{
modifyVars
}
from
'
./build/config/lessModifyVars
'
;
import
{
createProxy
}
from
'
./build/vite/proxy
'
;
import
{
configManualChunk
}
from
'
./build/vite/optimizer
'
;
import
globbyTransform
from
'
./build/vite/plugin/transform/globby
'
;
import
dynamicImportTransform
from
'
./build/vite/plugin/transform/dynamic-import
'
;
...
...
@@ -53,9 +54,11 @@ const viteConfig: UserConfig = {
// terser options
terserOptions
:
{
compress
:
{
keep_infinity
:
true
,
drop_console
:
VITE_DROP_CONSOLE
,
},
},
define
:
{
__VERSION__
:
pkg
.
version
,
// setting vue-i18-next
...
...
@@ -64,12 +67,14 @@ const viteConfig: UserConfig = {
__VUE_I18N_FULL_INSTALL__
:
false
,
__INTLIFY_PROD_DEVTOOLS__
:
false
,
},
cssPreprocessOptions
:
{
less
:
{
modifyVars
:
modifyVars
,
javascriptEnabled
:
true
,
},
},
// The package will be recompiled using rollup, and the new package compiled into the esm module specification will be put into node_modules/.vite_opt_cache
optimizeDeps
:
{
include
:
[
...
...
@@ -80,11 +85,6 @@ const viteConfig: UserConfig = {
],
},
proxy
:
createProxy
(
VITE_PROXY
),
plugins
:
createVitePlugins
(
viteEnv
),
rollupInputOptions
:
{
plugins
:
createRollupPlugin
(),
},
transforms
:
[
globbyTransform
({
resolvers
:
resolvers
,
...
...
@@ -94,6 +94,19 @@ const viteConfig: UserConfig = {
}),
dynamicImportTransform
(
VITE_DYNAMIC_IMPORT
),
],
proxy
:
createProxy
(
VITE_PROXY
),
plugins
:
createVitePlugins
(
viteEnv
),
rollupInputOptions
:
{
plugins
:
createRollupPlugin
(),
},
rollupOutputOptions
:
{
compact
:
true
,
manualChunks
:
configManualChunk
,
},
};
export
default
viteConfig
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录