Closed exocom closed 2 years ago
Hey @exocom thanks for reaching out.
This is actually intentional behavior. Node.js has decided that file extensions are mandatory, and Microsoft has decided not to rewrite import extensions. That is why an import from "./foo.js"
is the proper form in a TypeScript source file in a project with "type": "module"
, and we anticipate that it'll become the common form.
Consequently, I'll close this issue. But, just out of curiosity, what loader/bundler are you using? There are options to work around this issue depending on your setup.
Expected
Got: .js at end of import line.
Looked at making these changes, however, the
deriveImportPath
is used to determine imports. Making changes there affects all imports.Was able to get the desired affect by changing the
elToContent
function. Passing in bool and then replace ".js" with "".Example: