esbuild-register

3.6.0 • Public • Published

esbuild-register

npm version npm downloads

Install

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

Usage

node -r esbuild-register file.ts

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

Experimental loader support

When using in a project with type: "module" in package.json, you need the --loader flag to load TypeScript files:

node --loader esbuild-register/loader -r esbuild-register ./file.ts

Programmatic Usage

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

const { unregister } = register({
  // ...options
})

// Unregister the require hook if you don't need it anymore
unregister()

Sponsors

sponsors

License

MIT © EGOIST

Readme

Keywords

none

Package Sidebar

Install

npm i esbuild-register

Weekly Downloads

4,635,598

Version

3.6.0

License

MIT

Unpacked Size

182 kB

Total Files

9

Last publish

Collaborators

  • egoist