Closed mjbvz closed 3 years ago
Fixed by the addition of module: node12
with #45884 (which includes support for .mjs
and .mts
files).
this future will only be in typescript 4.6 it got droped from the 4.5 time schedule https://github.com/microsoft/TypeScript/issues/46452#issuecomment-960454410
as Daniel (TypeScript Team Lead) pointed out
(Technically support did ship in 4.5, it relies on the module: nodenext
setting, it just issues an error saying it's experimental)
@weswigham does nodenext include everything that was included in node12 (package.json exports fild)?
They're mostly the same (except for some export map edge cases and the implied target), and both modes are included.
Is this really fixed? It doesn't seem so, at least not in all use cases. Particularly, there is no way to support a mixture of .mts
and .ts
when using --module commonjs
, all the emitted .mjs
files will be broken and not consumable by either module system. It is impossible with tsc
as far as I can tell, so I would not consider this fixed.
For the reason why, see my comment on #50985. This should be reopened.
From @Sti2nd on October 7, 2018 16:17
import { timpaniSounds } from "./soundImport.mjs";
In the above example VS code will show all javascript files when writing "./", but not javascript module files. So I didn't see the above file in the list when trying to import it. Not sure if this is a bug or a feature request.
Copied from original issue: Microsoft/vscode#60103