File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -860,6 +860,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
860860 for ( const file in bundle ) {
861861 const chunk = bundle [ file ]
862862 if ( chunk . type === 'chunk' ) {
863+ let chunkImportsPureCssChunk = false
863864 // remove pure css chunk from other chunk's imports,
864865 // and also register the emitted CSS files under the importer
865866 // chunks instead.
@@ -874,11 +875,14 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
874875 importedAssets . forEach ( ( file ) =>
875876 chunk . viteMetadata ! . importedAssets . add ( file ) ,
876877 )
878+ chunkImportsPureCssChunk = true
877879 return false
878880 }
879881 return true
880882 } )
881- chunk . code = replaceEmptyChunk ( chunk . code )
883+ if ( chunkImportsPureCssChunk ) {
884+ chunk . code = replaceEmptyChunk ( chunk . code )
885+ }
882886 }
883887 }
884888
You can’t perform that action at this time.
0 commit comments