Skip to content

Rollup plugin to automatically preserve shebangs in entry modules.

Notifications You must be signed in to change notification settings

developit/rollup-plugin-preserve-shebang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rollup-plugin-preserve-shebang

Automatically preserve a shebang in your entry file.

If you're building CLI's with Rollup, this will fix your npm bin being broken :)

Installation

npm i -D rollup-plugin-preserve-shebang

Usage

import shebang from 'rollup-plugin-preserve-shebang';

export default {
    plugins: [
        shebang()
    ]
}
shebang({
    // Override the entry. By default, uses `input` from config:
    entry: path.resolve(process.cwd(), 'src/foo.js'),

    // You can also set it manually if you want, which will always prepend it:
    shebang: '#!/usr/bin/env node'
})

License

MIT