Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add temporary hack for getting .mjs builds for node v14 #1266

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

ChristopherBiscardi
Copy link
Member

The Rust version of Toast works with node v14 esm, and the preact package specifically (but also the others) doesn't have valid esm builds for node.

The custom undocumented build system we're using isn't something I want to touch before we make sure this release and such works as a general approach. So this PR includes a small change to the build script to copy the module-appropriate js file from it's location in the preact package to the needed location, and adds additional metadata to the package.json in the form of the exports keyword. This will ensure that existing callers receive the same code as usual while import callers receive the .mjs code.

This is the smallest change I could make to execute this, but we'll probably want to move away from r to something like microbundle, which already supports this use case (as well as our existing ones) and is also well maintained and documented, if we want to pursue modern builds for more packages. (I'm happy to do this work in another PR).

@vercel vercel bot temporarily deployed to Preview September 14, 2020 05:31 Inactive
@vercel
Copy link

vercel bot commented Sep 14, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mdx/mdx/1o0ddu47q
✅ Preview: https://mdx-git-fork-christopherbiscardi-node-14-esm.mdx.vercel.app

@johno johno merged commit 4c9c02c into mdx-js:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants