@@ -21,7 +21,6 @@ const outFile = join(distDir, 'legacy-test-bundle.spec.js');
2121const ngcBinFile = join ( nodeModulesDir , '@angular/compiler-cli/bundles/src/bin/ngc.js' ) ;
2222const legacyOutputDir = join ( distDir , 'legacy-test-out' ) ;
2323
24-
2524/**
2625 * This script builds the whole library in `angular/components` together with its
2726 * spec files into a single IIFE bundle.
@@ -72,10 +71,10 @@ async function compileSassFiles() {
7271 for ( const file of sassFiles ) {
7372 const outRelativePath = relative ( projectDir , file ) . replace ( / \. s c s s $ / , '.css' ) ;
7473 const outPath = join ( projectDir , outRelativePath ) ;
75- const task = renderSassFileAsync ( file ) . then ( async ( content ) => {
74+ const task = renderSassFileAsync ( file ) . then ( async content => {
7675 console . info ( 'Compiled, now writing:' , outRelativePath ) ;
7776 await fs . promises . mkdir ( dirname ( outPath ) , { recursive : true } ) ;
78- await fs . promises . writeFile ( outPath , content )
77+ await fs . promises . writeFile ( outPath , content ) ;
7978 } ) ;
8079
8180 sassTasks . push ( task ) ;
@@ -93,7 +92,10 @@ async function compileSassFiles() {
9392async function compileProjectWithNgtsc ( ) {
9493 // Build the project with Ngtsc so that external resources are inlined.
9594 const ngcProcess = child_process . spawnSync (
96- 'node' , [ ngcBinFile , '--project' , legacyTsconfigPath ] , { shell : true , stdio : 'inherit' } ) ;
95+ 'node' ,
96+ [ ngcBinFile , '--project' , legacyTsconfigPath ] ,
97+ { shell : true , stdio : 'inherit' } ,
98+ ) ;
9799
98100 if ( ngcProcess . error || ngcProcess . status !== 0 ) {
99101 throw Error ( 'Unable to compile tests and library. See error above.' ) ;
@@ -137,9 +139,9 @@ async function createEntryPointSpecFile() {
137139/** Helper function to render a Sass file asynchronously using promises. */
138140async function renderSassFileAsync ( inputFile ) {
139141 return new Promise ( ( resolve , reject ) => {
140- sass . render (
141- { file : inputFile , includePaths : [ nodeModulesDir ] } ,
142- ( err , result ) => err ? reject ( err ) : resolve ( result . css ) ) ;
142+ sass . render ( { file : inputFile , includePaths : [ nodeModulesDir ] } , ( err , result ) =>
143+ err ? reject ( err ) : resolve ( result . css ) ,
144+ ) ;
143145 } ) ;
144146}
145147
@@ -149,10 +151,11 @@ async function renderSassFileAsync(inputFile) {
149151 */
150152async function createResolveEsbuildPlugin ( ) {
151153 return {
152- name : 'ng-resolve-esbuild' , setup : ( build ) => {
153- build . onResolve ( { filter : / @ a n g u l a r \/ / } , async ( args ) => {
154+ name : 'ng-resolve-esbuild' ,
155+ setup : build => {
156+ build . onResolve ( { filter : / @ a n g u l a r \/ / } , async args => {
154157 const pkgName = args . path . substr ( '@angular/' . length ) ;
155- let resolvedPath = join ( legacyOutputDir , pkgName )
158+ let resolvedPath = join ( legacyOutputDir , pkgName ) ;
156159 let stats = await statGraceful ( resolvedPath ) ;
157160
158161 // If the resolved path points to a directory, resolve the contained `index.js` file
@@ -168,8 +171,8 @@ async function createResolveEsbuildPlugin() {
168171
169172 return stats !== null ? { path : resolvedPath } : undefined ;
170173 } ) ;
171- }
172- }
174+ } ,
175+ } ;
173176}
174177
175178/** Creates an ESBuild plugin that runs the Angular linker on framework packages. */
@@ -183,8 +186,8 @@ async function createLinkerEsbuildPlugin() {
183186
184187 return {
185188 name : 'ng-linker-esbuild' ,
186- setup : ( build ) => {
187- build . onLoad ( { filter : / f e s m 2 0 2 0 / } , async ( args ) => {
189+ setup : build => {
190+ build . onLoad ( { filter : / f e s m 2 0 2 0 / } , async args => {
188191 const filePath = args . path ;
189192 const content = await fs . promises . readFile ( filePath , 'utf8' ) ;
190193 const { code} = await transformAsync ( content , {
0 commit comments