Created by: Timer
Fixes #5234 (closed). Closes #5235.
This pull request allows packages to import from dependencies who export a mjs file (instead of us giving a URL).
It also ensures that a user who uses mjs in their application gets a file.
I'm really getting tired of all of these mjs hacks, because now we "sort of" support mjs. e.g.:
If a user defines their module field in package.json as index.mjs and then explicitly import files with .mjs instead of being extensionless, we'll keep loading them.
I wonder if we can somehow tell webpack to not use module if the field is mjs? That would prevent this hack.