Cookbook Router

Bundler Plugins

Build-time Cookbook Router generation for Vite, Webpack, Rspack, Rollup, esbuild, and Bun.

The job

The plugins run Cookbook Router generation before application modules are compiled. That is the whole promise. The consuming code sees real files, not a virtual-module trick that works until another tool touches the graph.

Supported packages

BundlerPackagePublic constructor
Vite@cookbook/router-vite-plugincookbookRouterVitePlugin()
Webpack@cookbook/router-webpack-pluginnew CookbookRouterPlugin()
Rspack@cookbook/router-rspack-pluginnew CookbookRouterRspackPlugin()
Rollup and Rolldown@cookbook/router-rollup-plugincookbookRouterRollupPlugin()
esbuild@cookbook/router-esbuild-plugincookbookRouterEsbuildPlugin()
Bun@cookbook/router-bun-plugincookbookRouterBunPlugin()

Vite exports only the named factory. Webpack, Rspack, Rollup, esbuild, and Bun also expose a default export. Rspack additionally exports CookbookRouterPlugin as an alias of CookbookRouterRspackPlugin.

On this page