Skip to content

Commit

Permalink
perf: 优化预热常用文件功能
Browse files Browse the repository at this point in the history
  • Loading branch information
pany-ang committed Dec 13, 2024
1 parent 5aa09b0 commit c643b41
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineConfig(({ mode }) => {
// 端口被占用时,是否直接退出
strictPort: false,
// 是否自动打开浏览器
open: false,
open: true,
// 反向代理
proxy: {
"/api/v1": {
Expand All @@ -49,7 +49,11 @@ export default defineConfig(({ mode }) => {
cors: true,
// 预热常用文件,提高初始页面加载速度
warmup: {
clientFiles: ["./src/layouts/**/*.vue"]
clientFiles: [
"./src/layouts/**/*.*",
"./src/pinia/**/*.*",
"./src/router/**/*.*"
]
}
},
// 构建配置
Expand Down

0 comments on commit c643b41

Please sign in to comment.