0.0.2 • Published 1 year ago

@ersbeth/tsbuild v0.0.2

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

tsbuild

Minimal bundler/runner for javascript and typescript files. Uses esbuild under the hood for fast transpilation.

Installation

npm i -D @ersbeth/tsbuild

CLI Examples

Transpile a TS file and generate types:

npx tsbuild -f examples/typescript.example.ts -o tmp/ --types

Transpile all files in a folder :

npx tsbuild -d examples/ -o tmp/

Run transparently a TS file (clears built files after execution)

npx tsbuild -f examples/typescript.example.ts -o tmp/ --run --clear

Bundle and run a TS file on the fly:

npx tsbuild -f examples/bundle.example.ts -o tmp/ --bundle --run --clear

Config Examples

Use a config file instead of / to override CLI parameters:

npx tsbuild -c tsbuild.config.js
export default {
    tsbuild: {
        dir: "./examples",
        out: "./tmp",
        types:true,
    },
    esbuild: {
        bundle: true,
        packages: 'external',
        platform: 'neutral',
        target: 'esnext',
        sourcemap: true,
    }
}

Options

  • --config,-c: path to config file
  • --file,-f: input file
  • --dir,-d: input dir
  • --out,-o: output dir
  • --clear: clear built files
  • --run: run built files
  • --watch: auto-rebuild on save
  • --types: generate d.ts files
0.0.2

1 year ago

0.0.1

1 year ago