Skip to content

Conversation

@jakebailey
Copy link
Member

This includes #3344; I would merge that in first and then I'll rebase this one as it's more complicated.

Right now, the build script uses source level hacks to remove require calls and such. But with microsoft/TypeScript#49332 on the horizon, these source level hacks are going to be unstable.

Rather than try and maintain all of these regex replacements, rewrite the code using transpileModule. This should be a sure-fire method as we can use the helper TS uses to identify require calls and replace them with no-ops.

I've removed the part of the script which complains about leftover requires, as the transformer gets all of the "real" requires; anything left is a false positive from a string, or a call to sys.require which the transformer will also ensure is undefined as it removes the nodeSystem from use.

@jakebailey
Copy link
Member Author

Closing; #3356 is better.

@jakebailey jakebailey closed this Oct 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant