1. esbuild-register
Transpile JSX, TypeScript and esnext features on the fly with esbuild
esbuild-register
Package: esbuild-register
Last modified: Thu, 14 Sep 2023 08:23:30 GMT
Version: 3.5.0
License: MIT
Downloads: 15,483,356

Install

npm install esbuild-register
yarn add esbuild-register

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

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin