File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/angular/build/src/tools/esbuild Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -107,14 +107,18 @@ async function transformWithBabel(
107107 if ( externalMapMatch ) {
108108 const mapPath = path . resolve ( path . dirname ( filename ) , externalMapMatch [ 1 ] ) ;
109109 try {
110- const mapContent = fs . readFileSync ( mapPath , 'utf-8' ) ;
110+ const mapContent = await fs . promises . readFile ( mapPath , 'utf-8' ) ;
111111 const inlineMap = Buffer . from ( mapContent ) . toString ( 'base64' ) ;
112112 return data . replace (
113113 / ^ \/ \/ # s o u r c e M a p p i n g U R L = [ ^ \r \n ] * / m,
114114 `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${ inlineMap } ` ,
115115 ) ;
116- } catch {
116+ } catch ( error ) {
117117 // Map file not readable; return data with the original external reference
118+ // eslint-disable-next-line no-console
119+ console . warn (
120+ `Unable to inline sourcemap for '${ filename } ': ${ error instanceof Error ? error . message : error } ` ,
121+ ) ;
118122 }
119123 }
120124
You can’t perform that action at this time.
0 commit comments