File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -953,8 +953,18 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
953953 return
954954 }
955955
956+ // vite:asset cleans up earlier assets of 'renderChunk',
957+ // but with cssCodeSplit=false we may still emit CSS here.
958+ // So is our responsibility to respect emitAssets
959+ const canEmitAssets =
960+ config . command !== 'build' || this . environment . config . build . emitAssets
961+
956962 // extract as single css bundle if no codesplit
957- if ( ! this . environment . config . build . cssCodeSplit && ! hasEmitted ) {
963+ if (
964+ canEmitAssets &&
965+ ! this . environment . config . build . cssCodeSplit &&
966+ ! hasEmitted
967+ ) {
958968 let extractedCss = ''
959969 const collected = new Set < OutputChunk > ( )
960970 // will be populated in order they are used by entry points
You can’t perform that action at this time.
0 commit comments