Bao Bundler is a simple, code-driven asset bundler for web projects, engineered specifically for the Bun runtime. As of version 0.2.4, it offers an imperative build process through its core concepts of `Project`, `Flows` (defining what to bundle from sources like folders or files), and `Runners` (defining how to process assets, such as copying them). This approach grants maximum flexibility by allowing developers to define build steps directly in TypeScript code, diverging from configuration-file-driven bundlers. The package is in an early development phase, suggesting an active but potentially irregular release cadence as new features and refinements are introduced. Its key differentiator is the tight integration with Bun, leveraging Bun's performance for asset processing, and its highly customizable pipeline through custom `Flow` and `Runner` implementations.
npm install bao-bundlerVerified import paths — ran on the pinned version, not inferred.
Demonstrates defining a simple asset bundling process using `Project`, `FolderFlow`, `FileFlow`, and `CopyRunner` to copy static assets into a build directory.
Refer to the latest documentation and release notes for API changes before upgrading to new minor or patch versions.
Ensure your project is set up to run with Bun, using `bun install` for dependencies and `bun run <your-script.ts>` for execution.
Always use ES module `import` syntax for Bao Bundler and ensure your Bun project is configured for ESM.
Prefix your Bun command with the desired verbosity: `BAO_VERBOSITY=INFO bun run build.ts`.
Always verify your working directory or use absolute paths where appropriate. Consider using `path.join(import.meta.dir, 'your-path')` for paths relative to the script.
Run `bun install bao-bundler` to install the package.
Ensure you are running the script with Bun: `bun run build.ts`.
Ensure you are using ES module `import { Project } from 'bao-bundler';` and executing with Bun.Double-check the existence and correctness of the `source` path. Adjust it to be relative to where `bun run` is executed, or use an absolute path.