feat: add Electron hot-reload development mode
- Add electron-dev.mjs script for hot-reload development - Support automatic Electron dependency building - Start Remix dev server and Electron app concurrently - Add proper process management and cleanup - Fix preload script path for development mode - Add electron:dev and electron:dev:inspect npm scripts This enables developers to run 'pnpm electron:dev' for a complete hot-reload development experience with automatic rebuilding and process management.
This commit is contained in:
@@ -9,6 +9,9 @@ export function createWindow(rendererURL: string) {
|
||||
const bounds = store.get('bounds');
|
||||
console.log('restored bounds:', bounds);
|
||||
|
||||
// preload path
|
||||
const preloadPath = path.join(isDev ? process.cwd() : app.getAppPath(), 'build', 'electron', 'preload', 'index.cjs');
|
||||
|
||||
const win = new BrowserWindow({
|
||||
...{
|
||||
width: 1200,
|
||||
@@ -18,7 +21,7 @@ export function createWindow(rendererURL: string) {
|
||||
vibrancy: 'under-window',
|
||||
visualEffectState: 'active',
|
||||
webPreferences: {
|
||||
preload: path.join(app.getAppPath(), 'build', 'electron', 'preload', 'index.cjs'),
|
||||
preload: preloadPath,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user