A Rollup plugin that recognizes and preserves shebang (#!) lines in entry files, ensuring they remain at the top of the bundled output. Version 1.0.1 is current; ESM-only, requires Node.js >=18 or >=20, and Rollup >=4. Unlike alternatives that may strip or misplace shebangs, this plugin correctly retains them for CLI tools. Ships TypeScript types and has a minimal footprint.
npm install rollup-plugin-resolve-shebangVerified import paths — ran on the pinned version, not inferred.
Configures Rollup to preserve shebang line from src/cli.js into the output bundle.
Use import syntax and ensure Node.js >=18.0.0 or >=20.
Upgrade Rollup to version 4 or later.
Ensure your entry file is the one with the shebang; use manualChunks if needed.
Run 'npm install rollup-plugin-resolve-shebang' or 'yarn add rollup-plugin-resolve-shebang'.
Change to dynamic import: const { resolveShebang } = await import('rollup-plugin-resolve-shebang'); or use import at top level.Convert your project to ESM (type: module in package.json) or use dynamic import.