Doesn’t the article say to *omit* the file ext. in Node? E.g. import x from 'x'; should work regardless of whether the module is CJS or ESM.
-
-
-
My tweet doesn’t echo anything from the article directly. Module specifiers must be URLs for now, so import x from 'x' won’t work
End of conversation
New conversation -
-
-
I'm not ever going to use or support the .mjs extension in my modules.
-
Why?
- 7 more replies
New conversation -
-
-
It seems really weird to encourage a distinct file extension whereas per the relevant standards it uses the same MIME type as JavaScript.
-
Browsers get type=module as a hint; Node.js can detect the extension. Besides semantics, what’s gained by introducing a new MIME type?
- 5 more replies
New conversation -
-
-
After blog posts + github issues I am not sure what is an ELI5, it comes down to:
-
"the same Source may parse in both" => "the Source that parses in both doesn't always act the same" => "we need to pre-determine parser" =>
- 4 more replies
New conversation -
-
-
Probably https://github.com/bmeck/UnambiguousJavaScriptGrammar … , see https://github.com/tc39/tc39-notes/blob/master/es7/2017-01/jan-25.md#13iia-proposed-grammar-change-to-es-modules … still has cons and no pros except keeping .js but they were acceptable
-
It would be cool if the people in the know put together an ELI5 on why .mjs is required. I feel many (including myself) don't fully grasp
- 1 more reply
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.