File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,17 +135,19 @@ async function buildAssets(options: BuildOptions = {}) {
135135 if ( options . watch ) {
136136 console . log ( '👀 Starting watch mode...' ) ;
137137
138- // Initial build
138+ // Initial builds
139139 try {
140+ // Build CSS once before starting watcher
141+ await buildCSS ( { ...options , watch : false } ) ;
140142 await buildJS ( options ) ;
141- console . log ( '✅ Initial JS build completed' ) ;
143+ console . log ( '✅ Initial build completed' ) ;
142144 } catch ( error ) {
143145 console . error ( 'Initial build failed:' , error ) ;
144146 process . exit ( 1 ) ;
145147 }
146148
147149 // Start watchers (both return processes that stay alive)
148- const cssProc = await buildCSS ( options ) ;
150+ const cssProc = await buildCSS ( { ... options , watch : true } ) ;
149151 const jsProc = await watchJS ( options ) ;
150152
151153 console . log ( '✅ Watch mode started - files will rebuild on changes' ) ;
You can’t perform that action at this time.
0 commit comments