@@ -61,7 +61,8 @@ export interface CssOptions {
6161 * Enable/disable CSS code splitting.
6262 * When set to `false`, all CSS in the entire project will be extracted into a single CSS file named by {@link fileName}.
6363 * When set to `true`, CSS imported in async JS chunks will be preserved as chunks.
64- * @default false
64+ *
65+ * Defaults to `false`, but if `unbundle` is `true`, it defaults to `true` to preserve chunk splitting.
6566 */
6667 splitting ?: boolean
6768
@@ -204,6 +205,7 @@ export const defaultCssBundleName = 'style.css'
204205export function resolveCssOptions (
205206 options : CssOptions = { } ,
206207 topLevelTarget ?: string [ ] ,
208+ unbundle ?: boolean ,
207209) : ResolvedCssOptions {
208210 let cssTarget : string [ ] | undefined
209211 if ( options . target === false ) {
@@ -216,7 +218,7 @@ export function resolveCssOptions(
216218
217219 return {
218220 transformer : options . transformer ?? 'lightningcss' ,
219- splitting : options . splitting ?? false ,
221+ splitting : options . splitting ?? ! ! unbundle ,
220222 fileName : options . fileName ?? defaultCssBundleName ,
221223 minify : options . minify ?? false ,
222224 inject : options . inject ?? false ,
0 commit comments