nextron icon indicating copy to clipboard operation
nextron copied to clipboard

Import native node module + dylib file

Open idevelop opened this issue 1 year ago • 2 comments

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!

idevelop avatar May 23 '23 21:05 idevelop

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?

alexis-piquet avatar Jun 03 '23 11:06 alexis-piquet

@idevelop would you need help?

alexis-piquet avatar Jun 22 '23 19:06 alexis-piquet