fix(mp): lazyCodeLoading 仅生产构建启用,修复 DevTools/真机调试卡死

dev 模式(watch)下 lazyCodeLoading 导致 DevTools 内存膨胀至 2GB+ 卡死,
这是微信开发者工具的已知兼容问题。改为仅在 production 构建时启用。
This commit is contained in:
iven
2026-05-24 12:02:20 +08:00
parent b14d0d347f
commit befdeba77c

View File

@@ -1,5 +1,6 @@
export default defineAppConfig({
lazyCodeLoading: 'requiredComponents',
// 仅生产构建启用dev 模式下 lazyCodeLoading 导致 DevTools / 真机调试卡死
...(process.env.NODE_ENV === 'production' ? { lazyCodeLoading: 'requiredComponents' as const } : {}),
pages: [
'pages/index/index',
'pages/login/index',