Commit 5e6fb9f
fix: reset variable render names between outputs in the same generate (#6350)
When the same input bundle is generated for multiple outputs in one
`output` array, `Variable.renderBaseName` set during a chunked output's
import deconfliction (e.g. `vendor` for `_` imported from a chunk) was
left on the shared `Variable` instance. The next output's
`deconflictTopLevelVariables` then skipped that variable because of the
existing `renderBaseName`, so the function declaration was rendered as
`function vendor._(...)` — invalid JavaScript.
Reset `renderBaseName`/`renderName` for the chunk's top-level variables
at the start of `setIdentifierRenderResolutions`, before either the
exports loop or `deconflictChunk` reassigns them.
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>1 parent 7542834 commit 5e6fb9f
2 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1454 | 1454 | | |
1455 | 1455 | | |
1456 | 1456 | | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1457 | 1467 | | |
1458 | 1468 | | |
1459 | 1469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
212 | 247 | | |
213 | 248 | | |
214 | 249 | | |
| |||
0 commit comments