privatenumber / pkgroll

📦 Zero-config package bundler for Node.js + TypeScript
MIT License
1.01k stars 23 forks source link

Handle native node plugins #68

Open roryabraham opened 3 weeks ago

roryabraham commented 3 weeks ago

Hi 👋🏼

First PR in this repo so I'm open to feedback 🙂

This PR is pretty simple - it adds the https://github.com/danielgindi/rollup-plugin-natives rollup plugin to this repo, such that it can handle projects with dependencies that include native node modules as well as pure-JS modules.

An easy way to test this is using this branch in your npm link package.

Chokidar depends on a fsevents native node plugin. If you add it to your link package and use it, you'll get an error when pnpm prepack.

roryabraham commented 3 weeks ago

I'll throw up some testing steps in a little bit, but spoiler alert I tested this with https://github.com/privatenumber/link when I was trying to add chokidar (which it sounds we might not want to do anyways 🙃)