-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Change web
and bundler
output to mjs
#1941
Comments
To be clear, All other ecosystems (including the browser) traditionally use So, this isn't a choice between the "standard" and "wrong" way, this is a choice between two different standardized (and equally correct) ways. One of those ways has been around for decades, is well established, and works everywhere (including Node). The other way is extremely new, and Node only. Personally, I think we should continue to output |
You are absolutely correct, thank you! I spent some time researching this:
<script type="module" src="app.mjs">
So there is actually no standard in place at this point in time that says that But there are recommendations by both mozilla and google. |
For browsers, the extension is irrelevant. You can use any extension (or even no extension at all). The browser does not have special handling for What matters is using This is important, because most servers are configured to use the The Google article is quite old (June 2018), and things have changed since then. And the Mozilla article is a wiki that is created by volunteers, it is not necessarily official. The whole Right now, most tools do not support It's entirely possible that |
Sounds reasonable to me. |
Summary
Considering that we are producing ES modules on those output modes, the
correctrecommended file extension ismjs
, notjs
.Are we interested in implementing/fixing this? I would like to work on this if possible.
Additional Details
This would probably break a whole lot of things out there, and the benefit is "just" following
standardsrecommendations properly, or at least I'm not aware of any other advantage.See #1332 (comment).
The text was updated successfully, but these errors were encountered: