Commit 4dc0efb
committed
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.1 parent 853130f commit 4dc0efb
File tree
1 file changed
+7
-2
lines changed- packages/angular/build/src/tools/esbuild
1 file changed
+7
-2
lines changedLines changed: 7 additions & 2 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 | | |
| |||
0 commit comments