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

refactor: Output ESM files w/ .mjs when appropriate #950

Merged
merged 6 commits into from Apr 25, 2022

Conversation

rschristian
Copy link
Collaborator

Per the conversation on Slack, both modern and esm output formats may now create .mjs files when appropriate.

@changeset-bot
Copy link

changeset-bot bot commented Apr 25, 2022

🦋 Changeset detected

Latest commit: c9a7e90

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
microbundle Minor

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

@rschristian rschristian marked this pull request as draft April 25, 2022 18:05
README.md Outdated Show resolved Hide resolved
@rschristian rschristian marked this pull request as ready for review April 25, 2022 18:05
README.md Outdated Show resolved Hide resolved
: pkg['jsnext:main'] || 'x.esm.js',
: pkg['jsnext:main'] || pkgTypeModule
? 'x.esm.js'
: 'x.esm.mjs',
Copy link
Owner

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.

Suggested change
: 'x.esm.mjs',
: 'x.mjs',

Copy link
Collaborator Author

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.

Copy link
Owner

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.

rschristian and others added 2 commits April 25, 2022 13:13
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
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