Option to vendor binding files in top-level app?..
busticated opened this issue ยท 0 comments
busticated commented
hey there ๐
thanks for the super-helpful lib ๐
i'm looking for a way to "vendor" the binding files for my app such that dependencies (e.g. @serialport/bindings
) use the vendor'ed bindings files provided by the root app instead of their module-local default. i don't see a way to do this - am i just missing it?
very roughly, you could:
- determine the
app_root
(perhaps via app-root-path) - determine
module_name
(the package.jsonname
field for the module - e.g.@serialport/bindings
) - add a lookup entry to the list here which is resolved first and attempts to load from a path like:
['app_root', 'vendor', 'module_name', `abi-v${process.versions.modules}`, 'platform', 'arch', 'bindings']
...does that make sense and fit with your goals for this lib? happy to create a PR if so!
related: serialport/node-serialport#2044