fix: only manually chunk client components

This commit is contained in:
julien huang 2023-08-19 22:56:47 +02:00
parent 17ed315fa0
commit 85bc7d52c6

View File

@ -151,7 +151,7 @@ export const componentsChunkPlugin = createUnplugin((options: ComponentChunkOpti
config.build.rollupOptions = config.build.rollupOptions || {}
config.build.rollupOptions.output = config.build.rollupOptions.output || {}
const componentManualChunk = (id: string) => {
if (components.some(c => c.filePath === parseURL(decodeURIComponent(pathToFileURL(id).href)).pathname)) {
if (components.some(c => c.mode !== 'server' && !c.island && c.filePath === parseURL(decodeURIComponent(pathToFileURL(id).href)).pathname)) {
return basename(id)
}
}