electron-forge-docs icon indicating copy to clipboard operation
electron-forge-docs copied to clipboard

Hot reloading doesn't reload preload script

Open DeeGeeMan opened this issue 3 years ago • 1 comments

No matter which files I changed, Webpack watcher will refresh the page upon update. However, the preload.ts doesn't get loaded during this process. If type rs in the console as mentioned in the docs, it still doesn't load. It only works the first time the app is luanched.

Error:

Unable to load preload script: ~/.webpack/renderer/main_window/preload.js

DeeGeeMan avatar Dec 13 '21 22:12 DeeGeeMan

module.exports = { entry: { main_window: './src/renderer/main_window.ts', preload: './src/renderer/preload.ts', }, output: { filename: '[name].js', path: path.resolve(__dirname, '.webpack/renderer'), }, }; Add path of preload

Image

Nitish0777 avatar Mar 19 '25 19:03 Nitish0777