Skip to content

✨ Relidler: A flexible, unified, and fully automated bundler for TypeScript & JavaScript projects, as well as an NPM & JSR publishing tool.

License

Notifications You must be signed in to change notification settings

reliverse/relidler-js-bundler

Repository files navigation

@reliverse/relidler | Relidler | Reliverse Bundler

💖 GitHub Sponsors💬 Discord✨ Repo📦 NPM📚 Docs

@reliverse/relidler is a flexible, unified, and fully automated bundler for TypeScript and JavaScript projects, as well as an NPM and JSR publishing tool.

Features

  • 😘 Drop-in replacement for unbuild
  • relidler works via CLI and SDK
  • 📦 Automated NPM/JSR publishing
  • ✅ Ensures reliable JS/TS builds
  • 🔄 Handles automatic version bumps
  • 🔧 Eliminates package.json headaches
  • 🎯 Optimized for speed and modern workflows
  • 🛠️ Converts TypeScript aliases to relative paths
  • ✨ Packed with powerful features under the hood
  • 📝 Highly configurable flow via a configuration file
  • 🔌 Plugin system with two built-in plugins included

Getting Started

Ensure git, node.js, and bun/pnpm/yarn/npm are installed. Then:

Example Playground

Want to test Relidler before integrating it into your project? Clone the repo and build it using Relidler itself:

git clone https://github.com/reliverse/relidler.git
cd relidler
bun i
bun dev # bun src/main.ts --dev

Relidler Installation

  1. Install globally:

    bun i -g @reliverse/relidler

    Or update as needed:

    bun -g update --latest
  2. Prepare your project:

    a. Configure .gitignore:

    echo "*.log" >> .gitignore
    echo "dist-npm" >> .gitignore
    echo "dist-jsr" >> .gitignore
    echo "dist-libs" >> .gitignore

    b. Install config intellisense:

    bun add -D @reliverse/relidler-cfg

    c. Initialize relidler.cfg.ts:

    relidler
    • The relidler.cfg.ts file is automatically created on first run.
    • It's recommended to customize this file according to your needs.
    • Supported filenames: relidler.cfg.tsrelidler.config.tsbuild.pub.tsbuild.cfg.ts.
    • You can check an example config here: relidler.cfg.ts
  3. Run and enjoy:

    relidler

Plugins

Relidler includes a plugin system with two built-in plugins:

1. libraries-relidler-plugin

Builds and publishes specified subdirectories of your main project as separate packages.

Usage example: The @reliverse/relidler-cfg configuration for src/libs/cfg dir:

// relidler.cfg.ts
libsActMode: "main-and-libs",
libsDirDist: "dist-libs",
libsDirSrc: "src/libs",
libsList: {
  "@reliverse/relidler-cfg": {
    libDeclarations: true,
    libDescription: "@reliverse/relidler defineConfig",
    libDirName: "cfg",
    libMainFile: "cfg/cfg-main.ts",
    libPkgKeepDeps: false,
    libTranspileMinify: true,
  },
},

2. tools-relidler-plugin

Enables you to run specific Relidler features:

relidler tools --tool <tool> --input <dir> --out <file> [options]

Available tools:

  • agg: Generates aggregator file with content like export { getSomething } from "./utils.js". Note: Currently it replaces the file content, not appends.

Usage example: If you're exploring the Example Playground, you can try the following:

  1. Open src/libs/sdk/sdk-main.ts in your IDE.
  2. Press Ctrl+A, then Backspace. Run the command below and watch the magic happen:
bun tools:agg # Shortcut for:
bun src/main.ts tools --dev --tool agg --input src/libs/sdk/sdk-impl --out src/libs/sdk/sdk-main.ts --recursive --named --strip src/libs/sdk

API (for advanced users)

The SDK allows you to create new Relidler plugins or even extend your own CLI functionality.

bun add -D @reliverse/relidler-sdk

Usage example: @reliverse/cli leverages this SDK to extend its functionality.

TODO

  • Implement stable regular build and publish
  • Implement stable library build and publish
  • Achieve full drop-in replacement for unbuild
  • Support auto migration from build.config.ts
  • Allow plugins to extend Relidler's defineConfig
  • Support configuration via reliverse.{ts,jsonc}
  • Make config file optional with sensible defaults

Related

Special thanks to the project that inspired Relidler:

License

🩷 MIT © blefnk Nazar Kornienko

About

✨ Relidler: A flexible, unified, and fully automated bundler for TypeScript & JavaScript projects, as well as an NPM & JSR publishing tool.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published