@@ -30,6 +30,12 @@ interface PluginOptions {
3030 buildOptions : StaticBuildOptions ;
3131}
3232
33+ function isBuildCssBoundary ( id : string , ctx : { getModuleInfo : GetModuleInfo } ) : boolean {
34+ if ( isPropagatedAssetBoundary ( id ) ) return true ;
35+ const info = ctx . getModuleInfo ( id ) ;
36+ return info ? moduleIsTopLevelPage ( info ) : false ;
37+ }
38+
3339function rollupPluginAstroBuildCSS ( options : PluginOptions ) : VitePlugin [ ] {
3440 const { internals, buildOptions } = options ;
3541 const { settings } = buildOptions ;
@@ -158,7 +164,7 @@ function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] {
158164 const parentModuleInfos = getParentExtendedModuleInfos (
159165 scopedToModule ,
160166 this ,
161- isPropagatedAssetBoundary ,
167+ ( moduleId ) => isBuildCssBoundary ( moduleId , this ) ,
162168 ) ;
163169 for ( const { info : pageInfo , depth, order } of parentModuleInfos ) {
164170 if ( moduleIsTopLevelPage ( pageInfo ) ) {
@@ -230,7 +236,7 @@ function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] {
230236 const parentModuleInfos = getParentExtendedModuleInfos (
231237 id ,
232238 this ,
233- isPropagatedAssetBoundary ,
239+ ( importer ) => isBuildCssBoundary ( importer , this ) ,
234240 ) ;
235241 for ( const { info : pageInfo , depth, order } of parentModuleInfos ) {
236242 if ( isPropagatedAssetBoundary ( pageInfo . id ) ) {
0 commit comments