Skip to content

Commit 51c271f

Browse files
authoredJul 21, 2023
fix: display manualChunks warning only when a function is not used (#13797) (#13798)
1 parent 049404c commit 51c271f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎packages/vite/src/node/plugins/splitVendorChunk.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ export function splitVendorChunkPlugin(): Plugin {
113113
output.manualChunks = (id: string, api: ManualChunkMeta) => {
114114
return userManualChunks(id, api) ?? viteManualChunks(id, api)
115115
}
116+
} else {
117+
// else, leave the object form of manualChunks untouched, as
118+
// we can't safely replicate rollup handling.
119+
// eslint-disable-next-line no-console
120+
console.warn(
121+
"(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead.",
122+
)
116123
}
117-
// else, leave the object form of manualChunks untouched, as
118-
// we can't safely replicate rollup handling.
119-
// eslint-disable-next-line no-console
120-
console.warn(
121-
"(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.manualChunks`. Consider using the function form instead.",
122-
)
123124
} else {
124125
output.manualChunks = viteManualChunks
125126
}

0 commit comments

Comments
 (0)
Please sign in to comment.