Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on using with webpack #43

Open
doug-a-brunner opened this issue Jan 27, 2018 · 2 comments
Open

Documentation on using with webpack #43

doug-a-brunner opened this issue Jan 27, 2018 · 2 comments

Comments

@doug-a-brunner
Copy link

I just discovered after some digging that, for a module to work with node-bindings in a project that uses webpack, that module needs to be included in externals in webpack.config.js so that its code ends up in a directory from which its package.json can be found. Would it make sense to include this in the readme?

@erikjalevik
Copy link

If someone else struggles with this, here's what worked for me. I am using the npm package objc which depends on ref and ffi, who in turn depend on bindings.

Adding bindings as an external, as suggested in most threads, did not work. Neither did objc. But this did the trick in webpack.config.js:

  externals: {
    ref: 'require("ref")',
    ffi: 'require("ffi")'
  }

@knowroozi
Copy link

the solution from @erikjalevik didn't work for me, but the module mentioned in this comment helped -> jsdom/jsdom#2066 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants