A rollup plugin that prepends a hashbang (shebang) line to bundled JavaScript files for CLI use. The current stable version is 0.1.5. The plugin is minimalist and has no notable release cadence. It differentiates itself by being a straightforward, small plugin that simply adds a hashbang to the output bundle, allowing Rollup to generate executable CLI scripts. It supports a configurable hashbang via options and has no dependencies. It is only useful for Node.js CLI projects built with Rollup and should not be used for browser bundles.
npm install rollup-plugin-cliVerified import paths — ran on the pinned version, not inferred.
Minimal Rollup configuration that adds a Node.js hashbang to the output bundle.
Ensure your CLI script is the first entry point or combine outputs manually.
After bundling, run chmod +x on the output file.
Use a cross-platform tool like 'pkg' or include a post-build step to adjust line endings.
Run 'npm install rollup-plugin-cli' and use 'import cli from 'rollup-plugin-cli'' (no extension).
Use 'cli()' with parentheses, e.g., 'plugins: [ cli() ]'.
Structure your Rollup config so that the CLI entry point is the sole input or use a different plugin to add hashbangs per chunk.
No dependency data recorded yet.