I'm new into webpack, and I'm having an issue trying to resolve a subdependency.
I'm importing a dependency
that is trying to require a module from a specific folder (not the node_modules) (let's call it subdependency
). That folder contains two files:
subdependency/package.json
subdependency/build/Release/addon.node
subdependency/lib/src/index.js
(this index.js requires the addon.node)
I'm using webpack, and when importing my dependency it was not able to find subdependency
.
The subdependency is there but it was not accessible. I added a loader for loading .node files https://www.npmjs.com/package/native-ext-loader and it was still not working; trying to identify what was happening I modified in my build the require path from ./subdependency to ./subdependency/build/Release/addon.node and the file was accessible (so I guess the native ext loader is working fine, but it's not loading other files like the index.js).
I think the problem is that webpack is not able to understand that ./subpdendency is a module, or that I'm not loading it correctly.
Any suggestion or idea is welcome!