@@ -85,30 +85,30 @@ export const bootstrap = async (bud: Bud) => {
8585
8686 bud . hooks
8787 . fromMap ( {
88- ' location.@dist' : bud . context . paths . output ,
89- ' location.@modules' : bud . context . paths . modules ,
90- ' location.@src' : bud . context . paths . input ,
91- ' location.@storage' : bud . context . paths . storage ,
92- ' pattern.css' : / ^ (? ! .* \. m o d u l e \. c s s $ ) .* \. c s s $ / ,
93- ' pattern.cssModule' : / \. m o d u l e \. c s s $ / ,
94- ' pattern.csv' : / \. ( c s v | t s v ) $ / ,
95- ' pattern.font' : / \. ( t t f | o t f | e o t | w o f f 2 ? | i c o ) $ / ,
96- ' pattern.html' : / \. ( h t m l ? ) $ / ,
97- ' pattern.image' : / \. ( p n g | j p e ? g | g i f | w e b p ) $ / ,
98- ' pattern.js' : / \. ( m j s | j s x ? ) $ / ,
99- ' pattern.json' : / \. j s o n $ / ,
100- ' pattern.json5' : / \. j s o n 5 $ / ,
101- ' pattern.md' : / \. m d $ / ,
102- ' pattern.modules' : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s | v e n d o r ) / ,
103- ' pattern.sass' : / ^ (? ! .* \. m o d u l e \. s [ a c ] s s $ ) .* \. s [ a c ] s s $ / ,
104- ' pattern.sassModule' : / \. m o d u l e \. s [ a c ] s s $ / ,
105- ' pattern.svg' : / \. s v g $ / ,
106- ' pattern.toml' : / \. t o m l $ / ,
107- ' pattern.ts' : / \. ( m ? t s x ? ) $ / ,
108- ' pattern.vue' : / \. v u e $ / ,
109- ' pattern.webp' : / \. w e b p $ / ,
110- ' pattern.xml' : / \. x m l $ / ,
111- ' pattern.yml' : / \. y a ? m l $ / ,
88+ [ ` location.@dist` ] : bud . context . paths . output ,
89+ [ ` location.@modules` ] : bud . context . paths . modules ,
90+ [ ` location.@src` ] : bud . context . paths . input ,
91+ [ ` location.@storage` ] : bud . context . paths . storage ,
92+ [ ` pattern.css` ] : / ^ (? ! .* \. m o d u l e \. c s s $ ) .* \. c s s $ / ,
93+ [ ` pattern.cssModule` ] : / \. m o d u l e \. c s s $ / ,
94+ [ ` pattern.csv` ] : / \. ( c s v | t s v ) $ / ,
95+ [ ` pattern.font` ] : / \. ( t t f | o t f | e o t | w o f f 2 ? | i c o ) $ / ,
96+ [ ` pattern.html` ] : / \. ( h t m l ? ) $ / ,
97+ [ ` pattern.image` ] : / \. ( p n g | j p e ? g | g i f | w e b p ) $ / ,
98+ [ ` pattern.js` ] : / \. ( m j s | j s x ? ) $ / ,
99+ [ ` pattern.json` ] : / \. j s o n $ / ,
100+ [ ` pattern.json5` ] : / \. j s o n 5 $ / ,
101+ [ ` pattern.md` ] : / \. m d $ / ,
102+ [ ` pattern.modules` ] : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s | v e n d o r ) / ,
103+ [ ` pattern.sass` ] : / ^ (? ! .* \. m o d u l e \. s [ a c ] s s $ ) .* \. s [ a c ] s s $ / ,
104+ [ ` pattern.sassModule` ] : / \. m o d u l e \. s [ a c ] s s $ / ,
105+ [ ` pattern.svg` ] : / \. s v g $ / ,
106+ [ ` pattern.toml` ] : / \. t o m l $ / ,
107+ [ ` pattern.ts` ] : / \. ( m ? t s x ? ) $ / ,
108+ [ ` pattern.vue` ] : / \. v u e $ / ,
109+ [ ` pattern.webp` ] : / \. w e b p $ / ,
110+ [ ` pattern.xml` ] : / \. x m l $ / ,
111+ [ ` pattern.yml` ] : / \. y a ? m l $ / ,
112112 } )
113113 . when ( bud . isDevelopment , ( { hooks} ) =>
114114 hooks . fromMap ( {
@@ -135,7 +135,21 @@ export const bootstrap = async (bud: Bud) => {
135135 } ) ,
136136 )
137137
138- bud . isRoot && bud . after ( bud . module . after )
138+ /**
139+ * Certain services are only available via the root instance of {@link Bud}.
140+ * Ensure that they always refer to the parent instance.
141+ */
142+ if ( ! bud . isRoot ) {
143+ bud . set ( `compiler` , bud . root . compiler )
144+ bud . set ( `dashboard` , bud . root . dashboard )
145+ if ( bud . isDevelopment ) {
146+ bud . set ( `server` , bud . root . server )
147+ }
148+ }
149+
150+ if ( bud . isRoot ) {
151+ bud . after ( bud . module . after )
152+ }
139153
140154 await bud . executeServiceCallbacks ( `bootstrap` )
141155 await bud . executeServiceCallbacks ( `register` )
0 commit comments