-
Notifications
You must be signed in to change notification settings - Fork 1k
[Request] Support bundling native addons inside the executable #329
Comments
@igorklopov is there anything planned to support this? Any direction / advice we could take to help the community? |
When application is running it must have |
@igorklopov afaik
So a new feature is still needed to allow native files to be included in the build. Would you mind giving an example of step 2? Thanks! |
@gurisko I'm stuck there as well. |
If the I wonder if there is a way to tell node to use a custom path in e.g. /tmp for |
I ended up bundling the app with webpack where I included this rule:
And now we ship our app with the build and the "libs" folder where .node files are located. @maxogden Try using it with |
I updated
with our packaged app and we don't have to execute our app from the same directory where |
But why doesn't So we can do e.g. this:
But not this:
Seems like an arbitrary constraint to me... |
Here's how I ended up dealing with this, maybe this will helps others in the future (and maybe inspiration for the pkg team? 😄 ): PREPARATION
START OF APP
EXITING THE APP
|
A workarround but pretty elegant though @s-h-a-d-o-w. I'd find this very useful if it was officially implemented as you did. This native modules thing brought me crazy yesterday. I'll give it a try. Thanks! and thanks pkg team. |
@dinigo |
Hi @igorklopov ! |
FWIW, electron handles this by unpacking on demand, see https://github.com/electron/electron/blob/6f91af93433df4e9c0e7fb592e5b2dcb0b1c7888/docs/tutorial/application-packaging.md#extra-unpacking-on-some-apis |
Initial support has been merged with #837. If there's anything else missing, please feel free to contribute back and I will take a look at the PR. Thank you! 🙏 |
Hi, we are using pkg and loving it so far, but it would be much nicer if we could include our
.node
files inside the single executable at the end. I saw this mentioned in the readme as not resolved, but could not find and issue for it.The text was updated successfully, but these errors were encountered: