Fix the duplicate export initialization (#14272)#14276
Fix the duplicate export initialization (#14272)#14276JasinYip wants to merge 1 commit intobabel:mainfrom
Conversation
There was a problem hiding this comment.
Thanks! Could you add a test like the one I suggested in #14272 (comment)? It can go in a new packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/many-exports-chunked/ folder. You only have to create the options.json and input.mjs files, then yarn jest modules will automatically generate the output.js file.
|
@nicolo-ribaudo No problem, I will add some tests. |
JLHwung
left a comment
There was a problem hiding this comment.
For reviewers: The rationale for this PR is that the uninitializedExportNames should be reset after they have been transformed to init statements. We have reset them when we found non-empty initStatements, but failed to do so at the chunk end.
|
Ping @JasinYip, we just need a test for the fixed behavior and then this PR can be merged 🙂 |
The array
uninitializedExportNameshaven't reset to[]so the array would contains the previous chunks. This will make lots of duplicate initialization statements while the amount of exports more than 100.For more detail: #14272