huozhi / bunchee

Zero config bundler for ECMAScript and TypeScript packages
https://npmjs.com/bunchee
926 stars 29 forks source link

feat: prepend shebang plugin #504

Closed hyoban closed 6 months ago

hyoban commented 6 months ago

close #415

credit: https://github.com/privatenumber/pkgroll/blob/bbb87f6410668e4c99af768ec0d2b021f8375824/src/utils/rollup-plugins/patch-binary.ts

  1. If there is no shebang line for bin entry, #!/usr/bin/env node\n will be prepended automatically.
  2. If the bin entry already started with a shebang line, the code will not be changed
hyoban commented 6 months ago

Thanks to your nice reviews too