更新依赖版本,优化组件和服务工作者的导入,调整 SCSS 混合宏,修复 Vite 配置中的文件缓存大小限制

This commit is contained in:
jxxghp
2025-01-16 15:14:58 +08:00
parent c718d57e77
commit ed3f66681f
9 changed files with 2855 additions and 3954 deletions
+10 -6
View File
@@ -55,12 +55,11 @@ export default defineConfig({
},
],
navigateFallback: '/index.html', // 确保页面路由正确加载
navigateFallbackDenylist: [
/.*\/api\/v\d+\/system\/logging.*/,
],
navigateFallbackDenylist: [/.*\/api\/v\d+\/system\/logging.*/],
},
injectManifest: {
rollupFormat: 'iife',
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
},
devOptions: {
enabled: true,
@@ -157,16 +156,14 @@ export default defineConfig({
'@images': fileURLToPath(new URL('./src/assets/images/', import.meta.url)),
'@styles': fileURLToPath(new URL('./src/styles/', import.meta.url)),
'@configured-variables': fileURLToPath(new URL('./src/styles/variables/_template.scss', import.meta.url)),
'apexcharts': fileURLToPath(new URL('node_modules/apexcharts-clevision', import.meta.url)),
'apexcharts': fileURLToPath(new URL('node_modules/apexcharts', import.meta.url)),
},
},
build: {
minify: 'terser',
terserOptions: {
compress: {
// 控制console.log()是否被移除,生产环境建议移除,存在内存泄漏风险
drop_console: true,
// 控制debugger是否被移除,酌情处理
drop_debugger: false,
},
},
@@ -193,4 +190,11 @@ export default defineConfig({
},
},
},
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
},
},
},
})