Closed bvaughn closed 7 years ago
cc @spicyj
Test pls.
Not sure how to repro the problem in a test within the context of this project. 🙁 Will have to look into it.
We should maybe be transforming import
s here as well… cc @josephsavona
I've added the 'es2015-modules-commonjs' transform to the 'inline-requires' test to catch the previous failure and verify the fix.
@zpao If we decide to do import
as well, maybe we could follow up on that with a separate PR (so as to unblock things internally)? I'd be happy to help with this.
Ok @spicyj, back to you!
Many thanks.
Let me know once babel-preset-fbjs@2.1.2 is out and I'll update my sync and try again. 😁
My recent changes to the inline-requires transform caused unintended problems when ran alongside other transforms (eg 'babel-plugin-transform-es2015-modules-commonjs').
The fix for this is to avoid re-processing the entire AST as we may interfere with modifications made by other plug-ins. Instead the 'inline-requires' transform tracks
Identifier
s and updates them (only) if we later remove arequire
they were depending on.