TooTallNate / node-bindings

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

Usage with esbuild triggers warnings #73

Open tcodes0 opened 3 years ago

tcodes0 commented 3 years ago

I'm using pg which seems to bring this in as a dep. esbuild complains when bundling

 > node_modules/bindings/bindings.js:94:8: warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning)
    94 │       : require;
       ╵         ~~~~~~~

this part seems to be the problem as it doesn't like require changing names.

Simplest solution is to remove that piece of code but that might break webpack support, so not sure.

Not too familiar with the lib or what it does, just opening for awareness