In an Electron-Typescript-React-Webpack app I'm trying to keep contextIsolation: true and use preload.
In electronjs.org docs I read : "preload String (optional) - Specifies a script that will be loaded before other scripts run in the page. This script will always have access to node APIs no matter whether node integration is turned on or off. The value should be the absolute file path to the script. " .
With preload: path.join(__dirname, './preload/preload.ts'),
I get : unable to load preload script: /home/marco/webMatters/electronMatters/electron-react-boilerplate/src/preload/preload.ts
.
But this is the actual absolute path to preload.ts :
(base) marco@pc01:~/webMatters/electronMatters/electron-react-boilerplate/src/preload$ ls -lah
total 12K
drwxr-xr-x 2 marco marco 4,0K feb 12 11:52 .
drwxr-xr-x 5 marco marco 4,0K feb 12 11:54 ..
-rw-r--r-- 1 marco marco 1,7K feb 12 11:20 preload.ts
- node: v14.5.0
- electron: v11.0.1
- O.S.: Ubuntu 18.04.4 Desktop
Any suggestions?