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

Update webpack to v4 for .mjs support #41

Closed
jaydenseric opened this issue Feb 20, 2018 · 2 comments
Closed

Update webpack to v4 for .mjs support #41

jaydenseric opened this issue Feb 20, 2018 · 2 comments

Comments

@jaydenseric
Copy link
Contributor

Packages should publish .mjs (ESM) files sibling to .js (CJS) files and use extensionless imports to support both Node.js native modules and traditional CJS environments. I'm already using .mjs in 4+ packages and use native modules for a few APIs.

Webpack v4 beta supports .mjs while v3 has a lot of issues; namely it resolves .js instead of .mjs for extensionless imports. This stuffs up tree-shaking and incorrectly results in almost identical size-limit results for .mjs and .js entries.

The latest webpack release is v4.0.0-beta.2. According to this tweet, v4 will ship at least a month after the first release candidate. This could be months away; I don't think waiting for a "stable" release is worth delaying an update.

@ai
Copy link
Owner

ai commented Feb 20, 2018

Good point. I am thinking to release mjs packages as well. Do you want to send PR?

@ai
Copy link
Owner

ai commented Feb 23, 2018

Released in 0.15.

@ai ai closed this as completed Feb 23, 2018
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 a pull request may close this issue.

2 participants