Tools
Small build primitives for libraries powered by Bun and oxc-transform. The package exposes four functions that compose into a single bun build script.
Functions
build— wrapsBun.buildwith sensible library defaults (ESM, minify, sourcemaps).clean— Bun plugin that removes a directory before bundling.copy— Bun plugin that copies a file after bundling.dts— Bun plugin that emits.d.tsfiles viaoxc-transform's isolated declarations.
Quick example
ts
// build.ts
import { build, clean, copy, dts } from '@basmilius/tools';
await build({
entrypoints: ['src/index.ts'],
plugins: [
clean('dist'),
dts(),
copy('package.json', 'dist/package.json')
]
});Run with bun build.ts.