|
|
@ -110,22 +110,29 @@ export async function bundle(
|
|
|
|
: 'assets/chunks/[name].[hash].js'
|
|
|
|
: 'assets/chunks/[name].[hash].js'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
manualChunks(id, ctx) {
|
|
|
|
manualChunks(id, ctx) {
|
|
|
|
// optimize default theme chunking
|
|
|
|
if (lazyDefaultThemeComponentsRE.test(id)) {
|
|
|
|
if (
|
|
|
|
return
|
|
|
|
id.includes(`${clientDir}/theme-default`) &&
|
|
|
|
}
|
|
|
|
!lazyDefaultThemeComponentsRE.test(id)
|
|
|
|
if (id.startsWith(`${clientDir}/theme-default`)) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
return 'theme'
|
|
|
|
return 'theme'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// move known framework code into a stable chunk so that
|
|
|
|
// move known framework code into a stable chunk so that
|
|
|
|
// custom theme changes do not invalidate hash for all pages
|
|
|
|
// custom theme changes do not invalidate hash for all pages
|
|
|
|
|
|
|
|
if (id.startsWith('\0vite')) {
|
|
|
|
|
|
|
|
return 'framework'
|
|
|
|
|
|
|
|
}
|
|
|
|
if (id.includes('plugin-vue:export-helper')) {
|
|
|
|
if (id.includes('plugin-vue:export-helper')) {
|
|
|
|
return 'framework'
|
|
|
|
return 'framework'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
id.includes(`${clientDir}/app`) &&
|
|
|
|
|
|
|
|
id !== `${clientDir}/app/index.js`
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
return 'framework'
|
|
|
|
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
isEagerChunk(id, ctx.getModuleInfo) &&
|
|
|
|
isEagerChunk(id, ctx.getModuleInfo) &&
|
|
|
|
(/@vue\/(runtime|shared|reactivity)/.test(id) ||
|
|
|
|
/@vue\/(runtime|shared|reactivity)/.test(id)
|
|
|
|
id.includes(clientDir))
|
|
|
|
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
return 'framework'
|
|
|
|
return 'framework'
|
|
|
|
}
|
|
|
|
}
|
|
|
|