1.0.5 • Published 1 year ago

swc-register v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

swc-register

NPM version NPM downloads

Transpile JSX, TypeScript and esnext features on the fly with swc.

It will respect your tsconfig.json (and .swcrc if provided).

Install

npm i @swc/core swc-register -D
# Or Yarn
yarn add @swc/core swc-register --dev
# Or pnpm
pnpm add @swc/core swc-register -D

Usage

node -r swc-register file.ts

It will use every mappable options from your tsconfig.json to make swc works.

You can also add an npm script:

"ts": "node -r swc-register"

Now just run npm run ts -- file.ts or yarn ts file.ts instead.

Programmatic Usage

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

register({
  // ...swc options
})

Similar Projects

There are some other swc registers like:

License

MIT