(This blog post is based on a tweet thread and additional input by Mathias Bynens.)
.mjsfor modules now?
The RFC does not mean that we have to use the filename extension
.mjs for modules – we can continue to use whatever extension we like. In other words, this RFC is good news for everyone – regardless of personal preferences w.r.t. filename extensions.
On Node.js we have two options:
We can also pass “string input” to Node.js via
Deno supports the filename extensions
.mjs. Files with these extensions are always interpreted as ECMAScript modules (in TypeScript syntax if the extension is
Web browsers don’t care about filename extensions at all, only about MIME types. Therefore, we can use any filename extension as long as our web server serves the files as