Features
- Bump
esbuild
to^15.16.0
version.
Previously using the14.x
release cycle.
This15.x
range includes features such as:
* Yarn Plug'N'Play (PnP) support
* Improved Yarn Workspaces support
* Newsupported
options (accessible within tsm config)
* Support for TypeScript 4.9satisfies
operator (#42)
* Improvedimports
subpath resolution (#31)
* Addsdeno
as a validtarget
value
* & more.. see esbuild changelog!
Patches
-
Correctly resolve non-
.js
file when requiring or importing the would-be.js
virtual path (#33):
TypeScript allows (and expects) you to writeimport("./App.js")
in your source, even though onlyApp.tsx
orApp.jsx
exists 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,tsm
left 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.tsx
file type. This release now covers this use case, allowing CommonJS/--require
users to dynamically import any non-.js
file...tsm
will transform it correctly, as configured. -
Improve source map support for
tsm <file>
CLI usage (#32):
When runningtsm
directly, the--enable-source-maps
flag is enabled for native Node.js sourcemap support. This means that any errors / stack traces will correctly map to the.ts
source locations!Note: If running
node -r tsm
ornode --loader tsm
, then you must include the--enable-source-maps
flag manually.
Full Changelog: v2.2.2...v2.3.0