Skip to content

Commit 7d519d8

Browse files
committed
fix(@angular/build): pass process environment variables to prerender workers
Worker processes used for prerendering and route extraction now inherit `process.env`. This ensures that any custom environment variables required by the application are available during the server-side rendering process. Closes #32730
1 parent 93a6f36 commit 7d519d8

File tree

1 file changed

+2
-0
lines changed
  • packages/angular/build/src/utils/server-rendering

1 file changed

+2
-0
lines changed

packages/angular/build/src/utils/server-rendering/prerender.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ async function renderPages(
227227
execArgv: workerExecArgv,
228228
env: {
229229
'NG_ALLOWED_HOSTS': 'localhost',
230+
...process.env,
230231
},
231232
});
232233

@@ -342,6 +343,7 @@ async function getAllRoutes(
342343
execArgv: workerExecArgv,
343344
env: {
344345
'NG_ALLOWED_HOSTS': 'localhost',
346+
...process.env,
345347
},
346348
});
347349

0 commit comments

Comments
 (0)