A rolldown and rollup plugin for bundling Deno code.
Still early days and it will probably not work well for npm packages atm (ex. ESM/CJS interop is not implemented).
- Discovers your deno.json and deno.lock file.
- Uses the same code as is used in the Deno CLI, but compiled to Wasm.
You must run rolldown via Deno
or this won't work (running it via Node.js
would require this issue to
be resolved).
deno install npm:rolldown jsr:@deno/rolldown-plugin
- Add a
bundle
task to your deno.json file: - Add a
rolldown.config.js
file and specify the Deno plugin. Configure the input and output as desired. For example:import denoPlugin from "@deno/rolldown-plugin"; import { defineConfig } from "rolldown"; export default defineConfig({ input: "./main.js", output: { file: "bundle.js", }, plugins: denoPlugin(), });
- Run
deno task bundle
.