Commit 75fa94c
fix(@angular/build): alias createRequire banner import to avoid duplicate binding
ESBuild processes banner content as raw text outside of its module graph,
so it cannot deduplicate or rename banner imports the way it does for user
imports. If user code already imports `createRequire` from `node:module`,
the injected banner produces a duplicate binding that causes a runtime error.
Alias the banner import to `__ngCreateRequire` to avoid colliding with any
`createRequire` binding that esbuild may emit from bundled user code.
(cherry picked from commit 9b33e17)1 parent d009aa1 commit 75fa94c
1 file changed
Lines changed: 14 additions & 4 deletions
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
199 | 204 | | |
200 | | - | |
201 | | - | |
| 205 | + | |
| 206 | + | |
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
| |||
397 | 402 | | |
398 | 403 | | |
399 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
400 | 410 | | |
401 | | - | |
402 | | - | |
| 411 | + | |
| 412 | + | |
403 | 413 | | |
404 | 414 | | |
405 | 415 | | |
| |||
0 commit comments