Features
- Bump
esbuildto^15.16.0version.
Previously using the14.xrelease cycle.
This15.xrange includes features such as:
* Yarn Plug'N'Play (PnP) support
* Improved Yarn Workspaces support
* Newsupportedoptions (accessible within tsm config)
* Support for TypeScript 4.9satisfiesoperator (#42)
* Improvedimportssubpath resolution (#31)
* Addsdenoas a validtargetvalue
* & more.. see esbuild changelog!
Patches
-
Correctly resolve non-
.jsfile when requiring or importing the would-be.jsvirtual path (#33):
TypeScript allows (and expects) you to writeimport("./App.js")in your source, even though onlyApp.tsxorApp.jsxexists on disk. There are many other extension aliases like this, all of which are now supported:"*.js" // <-- [".js", ".ts", ".tsx", ".jsx"] "*.mjs" // <-- [".mjs", ".mts"] "*.cjs" // <-- [".cjs", ".cts"] "*.jsx" // <-- [".jsx", ".tsx"]
-
Fix dynamic imports within CommonJS files (#27)
Previously,tsmleft dynamic imports alone, relying on native behavior. However, this meant that thenode -r tsm <file>usage might encounter code likeimport("./Post.tsx")that would throw an error because nativeimport()cannot deal with the.tsxfile type. This release now covers this use case, allowing CommonJS/--requireusers to dynamically import any non-.jsfile...tsmwill transform it correctly, as configured. -
Improve source map support for
tsm <file>CLI usage (#32):
When runningtsmdirectly, the--enable-source-mapsflag is enabled for native Node.js sourcemap support. This means that any errors / stack traces will correctly map to the.tssource locations!Note: If running
node -r tsmornode --loader tsm, then you must include the--enable-source-mapsflag manually.
Full Changelog: v2.2.2...v2.3.0