Skip to content

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

Merged
rschristian merged 6 commits into
masterfrom
refactor/output-mjs-ext
Apr 25, 2022
Merged

rschristian merged 6 commits into
masterfrom
refactor/output-mjs-ext

Conversation

@rschristian

Copy link
Copy Markdown
Collaborator

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

@changeset-bot

changeset-bot Bot commented Apr 25, 2022 •

Copy link
Copy Markdown

🦋 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
Comment thread README.md Resolved
@rschristian
rschristian marked this pull request as ready for review April 25, 2022 18:05
Comment thread README.md Resolved
Comment thread src/index.js
: pkg['jsnext:main'] || 'x.esm.js',
: pkg['jsnext:main'] || pkgTypeModule
? 'x.esm.js'
: 'x.esm.mjs',

Copy link
Copy Markdown
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',

@rschristian rschristian Apr 25, 2022 •

Copy link
Copy Markdown
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
Copy Markdown
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>
Comment thread src/index.js Resolved
Comment thread src/index.js 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

2 participants