antfu / esbuild-register

Transpile JSX, TypeScript and esnext features on the fly with esbuild

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

esbuild-register

Install

npm i esbuild-register -D
# Or Yarn
yarn add esbuild-register --dev

esbuild is required as a peer dependency.

Usage

node -r esbuild-register file.ts

It will use jsxFactory, jsxFragmentFactory and target options from your tsconfig.json

When using Yarn, you can add an npm script:

"ts": "node -r esbuild-register"

to shorten the command, now just run yarn ts file.ts instead.

Programmatic Usage

const { register } = require('esbuild-register/dist/node')

register({
  // ...options
})

License

MIT © EGOIST w

About

Transpile JSX, TypeScript and esnext features on the fly with esbuild

License:MIT License


Languages

Language:TypeScript 97.1%Language:JavaScript 2.9%