TooTallNate / node-bindings

Helper module for loading your native module's `.node` file
MIT License
411 stars 94 forks source link

doesn't work with rollup #65

Open pjebs opened 4 years ago

pjebs commented 4 years ago

I'm trying to use this with rollup (bundler) and electron.

It doesn't seem to work: See https://github.com/TooTallNate/node-bindings/issues/29#issuecomment-614449532

pjebs commented 4 years ago

The error can be seen in my comment above.

tomsseisums commented 4 years ago

It's not rollup only, everything that will bundle into a single file will cause this problem.

tomsseisums commented 4 years ago

I temporarily fixed this for serialport by marking the serialport as external in webpack so that it's loaded from node_modules.

pjebs commented 4 years ago

I did something similar but it does mean I need to distribute the node_modules directory with my electron application.