Commit e2658ad 1 parent c0ec6be commit e2658ad Copy full SHA for e2658ad
File tree 1 file changed +5
-1
lines changed
packages/vite/src/node/plugins
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 {
860
860
for ( const file in bundle ) {
861
861
const chunk = bundle [ file ]
862
862
if ( chunk . type === 'chunk' ) {
863
+ let chunkImportsPureCssChunk = false
863
864
// remove pure css chunk from other chunk's imports,
864
865
// and also register the emitted CSS files under the importer
865
866
// chunks instead.
@@ -874,11 +875,14 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
874
875
importedAssets . forEach ( ( file ) =>
875
876
chunk . viteMetadata ! . importedAssets . add ( file ) ,
876
877
)
878
+ chunkImportsPureCssChunk = true
877
879
return false
878
880
}
879
881
return true
880
882
} )
881
- chunk . code = replaceEmptyChunk ( chunk . code )
883
+ if ( chunkImportsPureCssChunk ) {
884
+ chunk . code = replaceEmptyChunk ( chunk . code )
885
+ }
882
886
}
883
887
}
884
888
You can’t perform that action at this time.
0 commit comments