nextron
nextron copied to clipboard
Import native node module + dylib file
I'm setting up an Electron app that needs to be able to import a custom native node module (a something.node
file) that itself loads a dynamic library (a separate, libsomething.dylib
file).
I already have the pipeline to produce these two files, but I'm having trouble adding them into the nextron project. Effectively they should be treated as static files that should be able to be loaded via standard require
from the code in background.ts
.
- Where do I declare that these files must be copied into the built app and placed next to the final "background" bundle file so that it can import them?
- How can I make this also work in dev mode?
- Less of a priority, how do I coerce Typescript to understand what the native module import produces? Should I write a custom
.d.ts
file?
Thanks!
Hey @idevelop,nice to read you. Could you share a use case? Whats your libs contains, components, hooks, or backend things? Where would you want to load them?
@idevelop would you need help?