webpack-contrib / node-loader

node loader for native modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] Handling node-gyp-build, node-pre-gyp, binding etc.

Rush opened this issue · comments

Feature Proposal

Implement alternative modules to node-gyp-build, node-pre-gyp, binding - perhaps loadable as replacements via "resolve" that would help load appropriate .node file at build time.

Feature Use Case

Currently most native packages cannot be bundled due to code such as:

const binding = require('node-gyp-build')(path.join(__dirname, '..'));

and similar for other package like binding or node-pre-gyp

I think we need a webpack plugin here to handle this case and use webpack's parser hooks