Open aomarks opened 3 years ago
I have a project that depends on TTypescript 1.5.13. I can build the project with ttsc when my project uses Typescript 4.3.5. However if I upgrade to Typescript 4.5.2, this error is thrown:
TypeError: Cannot read property 'impliedNodeFormat' of undefined
Does this enhancement address that issue, or I have encountered an unreported bug?
Hello @robojeff. Do you have some repro?
@robojeff You using ts-transform-paths
? I found this bug report after trying to upgrade my own project: https://github.com/zerkalica/zerollup/issues/37
Node now supports ES modules, but there doesn't seem to be a way to import them from a
ttypescript
config.https://nodejs.org/api/esm.html
A CommonJS module can import an ES module like this:
ttypescript
could know to useimport
with a new plugin configuration option (e.g."module": true
).Or to be more automatic, it could follow the Node rules which are to 1) check it ends with
.mjs
and if so import as a module, 2) check if it ends with.cjs
and if so import as CommonJS, 3) otherwise check the package'spackage.json
for"type": "module"
.