File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
packages/angular_devkit/build_angular/src/builders/application Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 88
99import { BuilderContext } from '@angular-devkit/architect' ;
1010import type { Plugin } from 'esbuild' ;
11+ import { access , constants } from 'node:fs/promises' ;
1112import { createRequire } from 'node:module' ;
1213import path from 'node:path' ;
1314import {
@@ -129,11 +130,16 @@ export async function normalizeOptions(
129130 let fileReplacements : Record < string , string > | undefined ;
130131 if ( options . fileReplacements ) {
131132 for ( const replacement of options . fileReplacements ) {
133+ const fileReplaceWith = path . join ( workspaceRoot , replacement . with ) ;
134+
135+ try {
136+ await access ( fileReplaceWith , constants . F_OK ) ;
137+ } catch {
138+ throw new Error ( `The ${ fileReplaceWith } path in file replacements does not exist.` ) ;
139+ }
140+
132141 fileReplacements ??= { } ;
133- fileReplacements [ path . join ( workspaceRoot , replacement . replace ) ] = path . join (
134- workspaceRoot ,
135- replacement . with ,
136- ) ;
142+ fileReplacements [ path . join ( workspaceRoot , replacement . replace ) ] = fileReplaceWith ;
137143 }
138144 }
139145
You can’t perform that action at this time.
0 commit comments