Skip to content

Commit c643b41

Browse files
committed
perf: 优化预热常用文件功能
1 parent 5aa09b0 commit c643b41

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vite.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default defineConfig(({ mode }) => {
3434
// 端口被占用时,是否直接退出
3535
strictPort: false,
3636
// 是否自动打开浏览器
37-
open: false,
37+
open: true,
3838
// 反向代理
3939
proxy: {
4040
"/api/v1": {
@@ -49,7 +49,11 @@ export default defineConfig(({ mode }) => {
4949
cors: true,
5050
// 预热常用文件,提高初始页面加载速度
5151
warmup: {
52-
clientFiles: ["./src/layouts/**/*.vue"]
52+
clientFiles: [
53+
"./src/layouts/**/*.*",
54+
"./src/pinia/**/*.*",
55+
"./src/router/**/*.*"
56+
]
5357
}
5458
},
5559
// 构建配置

0 commit comments

Comments
 (0)