File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
packages/kit/src/exports/vite Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/kit ' : patch
3+ ---
4+
5+ fix: avoid Vite warning about unknown ` codeSplitting ` option
Original file line number Diff line number Diff line change @@ -932,9 +932,7 @@ async function kit({ svelte_config }) {
932932 assetFileNames : `${ prefix } /assets/[name].[hash][extname]` ,
933933 hoistTransitiveImports : false ,
934934 sourcemapIgnoreList,
935- inlineDynamicImports : is_rolldown ? undefined : ! split ,
936- // @ts -ignore: only available in Vite 8
937- codeSplitting : is_rolldown ? split : undefined
935+ inlineDynamicImports : is_rolldown ? undefined : ! split
938936 } ,
939937 preserveEntrySignatures : 'strict' ,
940938 onwarn ( warning , handler ) {
@@ -967,6 +965,13 @@ async function kit({ svelte_config }) {
967965 }
968966 }
969967 } ;
968+
969+ // we must reference Vite 8 options conditionally. Otherwise, older Vite
970+ // versions throw an error about unknown config options
971+ if ( is_rolldown && new_config ?. build ?. rollupOptions ?. output ) {
972+ // @ts -ignore only available in Vite 8
973+ new_config . build . rollupOptions . output . codeSplitting = split ;
974+ }
970975 } else {
971976 new_config = {
972977 appType : 'custom' ,
You can’t perform that action at this time.
0 commit comments