From 84831349275cc8c56fb3c2699fe665e3f4932624 Mon Sep 17 00:00:00 2001 From: Izhaki Date: Sat, 6 Sep 2025 22:36:21 +0300 Subject: [PATCH] Enhance transpiling.md with tsx setup details --- docs/transpiling.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/transpiling.md b/docs/transpiling.md index e8c11d644..b71839d01 100644 --- a/docs/transpiling.md +++ b/docs/transpiling.md @@ -10,6 +10,11 @@ For compiling TypeScript on the fly, you should install [ts-node](https://github npm install --save-dev ts-node ``` +> For an easier setup, one could use [tsx](https://github.com/privatenumber/tsx), and its `tsx/cjs` for commonjs transpilation or `tsx/esm` for esm transpilation. `tsx` bypasses typechecking and hence is not only faster, but also does not require a `tsconfig.json` to be setup. +> An example test script where step definitions are written in typescript would look like so: +> +> `"test": "cucumber-js --require-module tsx/cjs --require 'features/**/*.ts'"` + ## Module format The first thing you need to establish is the JavaScript module format you are compiling to. It'll be either of: