Skip to content

Output directory structure for native modules for Electron - any risks here? #177

Description

@witcher112

Hi!

First of all, thanks for the great project, I made my Rush monorepo work with electron-builder thanks to that!

I wanted to ask about the situation with the output directory structure for Electron. I saw electron-forge uses a directory called "narive_modules" but I couldn't find any information on why. Besides that, in the code itself, there is a comment:

// retain directory depth structure for binaries for rpath to work out

It seems important as well but I still can't understand how it matters. (do some packages have tendencies to do some relative path operations with native modules?)

I would be very grateful if someone can explain the reasons for all of that, I just want to be sure that nothing could ever break in my app if I use a different output structure.

PS. I actually did a modification that allows prefixing the output path with the package name so instead of output structure like:

  • main.js
  • build/Release/keytar.node
  • prebuilds/win32-x64/node.napi.node

we can get:

  • main.js
  • keytar/build/Release/keytar.node
  • ffi-napi/prebuilds/win32-x64/node.napi.node

(my fork is based on @MarshallOfSound which makes the package work with modules like node-ffi)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions