-
Notifications
You must be signed in to change notification settings - Fork 363
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
refactor: Output ESM files w/ .mjs
when appropriate
#950
Conversation
🦋 Changeset detectedLatest commit: c9a7e90 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
: pkg['jsnext:main'] || 'x.esm.js', | ||
: pkg['jsnext:main'] || pkgTypeModule | ||
? 'x.esm.js' | ||
: 'x.esm.mjs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think .m.js
and .esm.js
were both poor approximations of .mjs
, and we should be able to drop the infix.
: 'x.esm.mjs', | |
: 'x.mjs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, though I wonder if that will confuse some.
For users who might not be super familiar with module formats, Microbundle is quite easy to understand given the current names: esm
-> x.esm.js
, umd
-> x.umd.js
, etc. esm
-> x.mjs
might be harder to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a reasonable thought, yeah. I could go either way on this.
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
Per the conversation on Slack, both modern and esm output formats may now create
.mjs
files when appropriate.