Skip to content

Commit

Permalink
fix: Only show the `build.rollupOptions.manualChunks using the functi…
Browse files Browse the repository at this point in the history
…on form` warning when a function is not used. (#13797)
  • Loading branch information
jafin committed Jul 12, 2023
1 parent ec9d2e7 commit 5b203e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vite/src/node/plugins/splitVendorChunk.ts
Expand Up @@ -113,13 +113,14 @@ export function splitVendorChunkPlugin(): Plugin {
output.manualChunks = (id: string, api: ManualChunkMeta) => {
return userManualChunks(id, api) ?? viteManualChunks(id, api)
}
}
} else {
// else, leave the object form of manualChunks untouched, as
// we can't safely replicate rollup handling.
// eslint-disable-next-line no-console
console.warn(
console.warn(
"(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.manualChunks`. Consider using the function form instead.",
)
)
}
} else {
output.manualChunks = viteManualChunks
}
Expand Down

0 comments on commit 5b203e8

Please sign in to comment.