I don't understand what actual concrete benefit there is to using .mjs on client-side JavaScript modules. It seems to only cause problems with tools that .js completely avoids. What's the specific upside?
It might become possible to use other extensions at the cost of yet-to-be-specified additional configuration.
-
-
Tools are increasingly adopting .mjs as a signal that the source file is a module instead of a classic script, reducing the need for additional configuration in build systems.
-
With .mjs for modules, the mental model is: // Decide which extension to use: extension = isModule ? '.mjs' : '.js' // Figure out if a given file is a module: isModule = extension === '.mjs'
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.