@ersbeth/tsbuild
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i @ersbeth/tsbuild

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

13.5 kB

Total Files

17

Last publish

Collaborators

  • erousset