Closed wisedier closed 3 years ago
I'm looking into how preload.js
is working/used in practice. It seems I'll also need to update current examples that have security warnings and preload seems to solve that. Unsure how preload gets access to external e.g. lodash
, but I'll get there.
Could you provide an example of how to make an external module for preload
to consume? I'd like to start with an example and I was under the impression that only electron
and Node APIs are exposed to the runtime as external natives.
I'm closing this for now as I do not have a reproducible use case.
In PR #41, we made esbuild make a bundle for
preload.js
. In this script, there is some cases use third party packages except for 'electron' such as 'lodash' and 'redis'. However default esbuild config 'external' only contains 'electron' so that 'preload.js' cannot import other third party packages. For this reason, I suggest to add the way to pass the additional config toget-esbuild-config.js
or load it in the script. If you think it is needed and you can give me some guide to do it with documentation, I will send PR.Example: