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

docs: add CJS/ESM emit entry #986

Merged
merged 4 commits into from
Oct 26, 2023
Merged

docs: add CJS/ESM emit entry #986

merged 4 commits into from
Oct 26, 2023

Conversation

JoshuaKGoldberg
Copy link
Owner

PR Checklist

Overview

I'm a little pleasantly surprised to remember that it's only two steps...!

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #986 (5200770) into main (76a7518) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #986   +/-   ##
=======================================
  Coverage   93.47%   93.47%           
=======================================
  Files          91       91           
  Lines        4860     4860           
  Branches      403      403           
=======================================
  Hits         4543     4543           
  Misses        316      316           
  Partials        1        1           
Flag Coverage Δ
create 71.10% <ø> (ø)
initialize 38.29% <ø> (ø)
migrate 69.95% <ø> (ø)
unit 68.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

1. In `tsup.config.ts`, change the [tsup `format` option](https://tsup.egoist.dev/#bundle-formats) from `["esm"]` to `["cjs", "esm"]`
2. Add a [`package.json` `"exports"` entry](https://nodejs.org/api/packages.html#subpath-exports) like:

<!-- eslint-disable jsonc/sort-keys -->
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 88f87b1 into main Oct 26, 2023
16 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the faq-cjs-esm branch October 26, 2023 09:09
@github-actions
Copy link

🎉 This is included in version v1.40.0 🎉

The release is available on:

Cheers! 📦🚀

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.

📝 Documentation: Add FAQ entry about adding dual CJS/ESM output
1 participant