Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
dd7f2124
Commit
dd7f2124
authored
Jan 19, 2026
by
cyhhao
Browse files
merge: resolve conflicts with main
parents
49be9d08
bba5b3c0
Changes
42
Show whitespace changes
Inline
Side-by-side
frontend/vite.config.ts
View file @
dd7f2124
...
...
@@ -58,7 +58,49 @@ export default defineConfig({
},
build
:
{
outDir
:
'
../backend/internal/web/dist
'
,
emptyOutDir
:
true
emptyOutDir
:
true
,
rollupOptions
:
{
output
:
{
/**
* 手动分包配置
* 分离第三方库并按功能合并应用代码,避免循环依赖
*/
manualChunks
(
id
:
string
)
{
if
(
id
.
includes
(
'
node_modules
'
))
{
// Vue 核心库
if
(
id
.
includes
(
'
/vue/
'
)
||
id
.
includes
(
'
/vue-router/
'
)
||
id
.
includes
(
'
/pinia/
'
)
||
id
.
includes
(
'
/@vue/
'
)
)
{
return
'
vendor-vue
'
}
// UI 工具库(较大,单独分离)
if
(
id
.
includes
(
'
/@vueuse/
'
)
||
id
.
includes
(
'
/xlsx/
'
))
{
return
'
vendor-ui
'
}
// 图表库
if
(
id
.
includes
(
'
/chart.js/
'
)
||
id
.
includes
(
'
/vue-chartjs/
'
))
{
return
'
vendor-chart
'
}
// 国际化
if
(
id
.
includes
(
'
/vue-i18n/
'
)
||
id
.
includes
(
'
/@intlify/
'
))
{
return
'
vendor-i18n
'
}
// 其他小型第三方库合并
return
'
vendor-misc
'
}
// 应用代码:按入口点自动分包,不手动干预
// 这样可以避免循环依赖,同时保持合理的 chunk 数量
}
}
}
},
server
:
{
host
:
'
0.0.0.0
'
,
...
...
frontend/vitest.config.ts
0 → 100644
View file @
dd7f2124
import
{
defineConfig
,
mergeConfig
}
from
'
vitest/config
'
import
viteConfig
from
'
./vite.config
'
export
default
mergeConfig
(
viteConfig
,
defineConfig
({
test
:
{
globals
:
true
,
environment
:
'
jsdom
'
,
include
:
[
'
src/**/*.{test,spec}.{js,ts,jsx,tsx}
'
],
exclude
:
[
'
node_modules
'
,
'
dist
'
],
coverage
:
{
provider
:
'
v8
'
,
reporter
:
[
'
text
'
,
'
json
'
,
'
html
'
],
include
:
[
'
src/**/*.{js,ts,vue}
'
],
exclude
:
[
'
node_modules
'
,
'
src/**/*.d.ts
'
,
'
src/**/*.spec.ts
'
,
'
src/**/*.test.ts
'
,
'
src/main.ts
'
],
thresholds
:
{
global
:
{
statements
:
80
,
branches
:
80
,
functions
:
80
,
lines
:
80
}
}
},
setupFiles
:
[
'
./src/__tests__/setup.ts
'
]
}
})
)
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment