File tree Expand file tree Collapse file tree
packages/angular/build/src/tools/esbuild/angular Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,27 +180,19 @@ export class ComponentStylesheetBundler {
180180 const watchFile = path . isAbsolute ( filename )
181181 ? filename
182182 : path . join ( this . options . workspaceRoot , filename ) ;
183- if ( result . errors ) {
184- for ( const error of result . errors ) {
185- if ( error . location ? .file . startsWith ( 'angular:styles/component:' ) ) {
186- error . location . file = filename ;
183+ for ( const message of [ ... ( result . errors ?? [ ] ) , ... ( result . warnings ?? [ ] ) ] ) {
184+ if ( message . location ?. file ?. startsWith ( 'angular:styles/component:' ) ) {
185+ message . location . file = filename ;
186+ if ( result . errors ) {
187187 bundlerContext . watchFiles . add ( watchFile ) ;
188188 }
189- for ( const note of error . notes ) {
190- if ( note . location ?. file . startsWith ( 'angular:styles/component:' ) ) {
191- note . location . file = filename ;
192- bundlerContext . watchFiles . add ( watchFile ) ;
193- }
194- }
195189 }
196- }
197- for ( const warning of result . warnings ) {
198- if ( warning . location ?. file . startsWith ( 'angular:styles/component:' ) ) {
199- warning . location . file = filename ;
200- }
201- for ( const note of warning . notes ) {
202- if ( note . location ?. file . startsWith ( 'angular:styles/component:' ) ) {
190+ for ( const note of message . notes ?? [ ] ) {
191+ if ( note . location ?. file ?. startsWith ( 'angular:styles/component:' ) ) {
203192 note . location . file = filename ;
193+ if ( result . errors ) {
194+ bundlerContext . watchFiles . add ( watchFile ) ;
195+ }
204196 }
205197 }
206198 }
You can’t perform that action at this time.
0 commit comments