electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

Correct way to use a preload script with electron-compile? #259

Closed ghost closed 7 years ago

ghost commented 7 years ago

When creating a BrowserWindow one may enable a webPreferences.preload script. This script is loaded before the window is created and has various uses (see linked documentation).

Unfortunately since this preload script isn't caught by electron-compile, and doesn't end up being cached with the rest of the app's source.

Is there a correct way to use a preload script with electron-compile?

malept commented 7 years ago

You'll have to do something like this:

https://github.com/electron-userland/electron-forge/wiki/Using-'preload'-scripts

(That should really be in the electron-compile README.)

ghost commented 7 years ago

Ah, I must have missed that. Thanks 👍

@malept I agree - at least adding a link in the README could help some users.