Skip to content

v2.3.0

Latest
Compare
Choose a tag to compare
@lukeed lukeed released this 28 Nov 03:43
· 4 commits to master since this release

Features

  • Bump esbuild to ^15.16.0 version.
    Previously using the 14.x release cycle.
    This 15.x range includes features such as:
    * Yarn Plug'N'Play (PnP) support
    * Improved Yarn Workspaces support
    * New supported options (accessible within tsm config)
    * Support for TypeScript 4.9 satisfies operator (#42)
    * Improved imports subpath resolution (#31)
    * Adds deno as a valid target 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 write import("./App.js") in your source, even though only App.tsx or App.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 the node -r tsm <file> usage might encounter code like import("./Post.tsx") that would throw an error because native import() 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 running tsm 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 or node --loader tsm, then you must include the --enable-source-maps flag manually.


Full Changelog: v2.2.2...v2.3.0