Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging application with native modules #88

Open
ceonizm opened this issue Jul 27, 2021 · 1 comment
Open

packaging application with native modules #88

ceonizm opened this issue Jul 27, 2021 · 1 comment

Comments

@ceonizm
Copy link
Contributor

ceonizm commented Jul 27, 2021

Hello,

I was wondering how do you deal with native modules.
When doing webpack I see bozon create a package.json in the build folder from its manifest function: this package.json doesn't comport any dependencies ; I totally understand it and why, as webpack is supposed to pack all the code in one file, but I don't see how to deal with the case of native modules that can't be packed.

In my current task I want to build an app with node-hid so at the end I need to have it listed in the package.json in the build/{env} folder in order electron-builder can handle it.

Is there a mechanism or a config in bozon that allows us to do that (eg: specify a list of depedencies to add) or does this kind of task is doable in webpack with a plugin ?

@ceonizm
Copy link
Contributor Author

ceonizm commented Jul 27, 2021

I finally succeeded to achieve my aim by writing a small webpack plugin that does the injection during the webpack phase.
I feel it a clean way to do it at that time, but I tend to think that it would be a good thing if Bozon should supply that kind of plugin to avoid people to rewrite it.

here is a version of the plugin I wrote if it can help or inspire somebody :)
https://github.com/ceonizm/BozonPackageDependencyInjectorPlugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant