Commit fa4d8ff 1 parent 8837719 commit fa4d8ff Copy full SHA for fa4d8ff
File tree 1 file changed +10
-4
lines changed
packages/angular_devkit/build_angular/src/builders/application
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import { BuilderContext } from '@angular-devkit/architect' ;
10
10
import type { Plugin } from 'esbuild' ;
11
+ import { access , constants } from 'node:fs/promises' ;
11
12
import { createRequire } from 'node:module' ;
12
13
import path from 'node:path' ;
13
14
import {
@@ -129,11 +130,16 @@ export async function normalizeOptions(
129
130
let fileReplacements : Record < string , string > | undefined ;
130
131
if ( options . fileReplacements ) {
131
132
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
+
132
141
fileReplacements ??= { } ;
133
- fileReplacements [ path . join ( workspaceRoot , replacement . replace ) ] = path . join (
134
- workspaceRoot ,
135
- replacement . with ,
136
- ) ;
142
+ fileReplacements [ path . join ( workspaceRoot , replacement . replace ) ] = fileReplaceWith ;
137
143
}
138
144
}
139
145
You can’t perform that action at this time.
0 commit comments