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

beta: build(esm): Use explicit .mjs extension for ESM, with CJS interop (#7… #7262

Merged
merged 4 commits into from
Dec 13, 2021

Conversation

bluebill1049
Copy link
Member

…261)

  • build(esm): Use explicit .mjs extension for ESM

This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs #7244
Refs #7095
Refs #7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750

  • fix(esm-interop): Import non-ESM React as default

)

* build(esm): Use explicit .mjs extension for ESM

This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs #7244
Refs #7095
Refs #7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750

* fix(esm-interop): Import non-ESM React as default
@bluebill1049 bluebill1049 changed the title build(esm): Use explicit .mjs extension for ESM, with CJS interop (#7… beta: build(esm): Use explicit .mjs extension for ESM, with CJS interop (#7… Dec 11, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2021

Size Change: -14.1 kB (-45%) 🎉

Total Size: 17.3 kB

Filename Size Change
dist/index.cjs.js 8.62 kB -66 B (-1%)
dist/index.esm.js 0 B -14 kB (removed) 🏆
dist/index.umd.js 8.72 kB -67 B (-1%)

compressed-size-action

@bluebill1049
Copy link
Member Author

bluebill1049 commented Dec 11, 2021

  • test CRA
  • test nextjs

yarn add react-hook-form@7.21.3-beta.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants