Closed huozhi closed 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/formium/tsdx/odwnhztnj
✅ Preview: https://tsdx-git-fork-huozhi-bin-support.formium.vercel.app
not sure why it's failed with node 12 + macOS, I'm currently using those as my local development env and installation + tests are passed locally.. 😂
got it, thanks for clarifying @agilgur5
@agilgur5 is that ok to use rollup-plugin-preserve-shebang to implement this feature? I can file another PR for it if the idea is acceptable for you
@huozhi unfortunately that will run into the same issue, it won't fix the index.js
file. You might notice from the codebase/repo that TSDX actually used it at one point (before it was partially removed).
The optimal solution is a good bit more complicated as it requires a nuanced Rollup plugin and refactoring several internals. I have a branch that does it, but haven't gotten around to testing it or prioritizing it (mostly because of issues written in my current status)
understood, manually generating index.js of cjs bundle is definitely a blocker for that solution. thanks for your patient explanation! 🙏
Use
rolloup.output.banner
to add shebang header into bundle. Resolves #338Changes
--bin
flagbin
is specified in package.json, output with shebang header