Skip to content

Commit c3d7b26

Browse files
bglgwyngclaude
andcommitted
feat(plugin-vite): make hot restart opt-in via plugin config
Add `hotRestart` option to VitePluginConfig (default: false). The main process restart is now only enabled when explicitly configured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 08fc3f1 commit c3d7b26

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

packages/plugin/vite/src/Config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ export interface VitePluginConfig {
4949
* @defaultValue `true`
5050
*/
5151
concurrent?: boolean | number;
52+
53+
/**
54+
* Enable hot restart for the main process when its bundle is rebuilt.
55+
* @defaultValue false
56+
*/
57+
hotRestart?: boolean;
5258
}

packages/plugin/vite/src/config/vite.main.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export function getConfig(
2020
external: [...external, 'electron/main'],
2121
},
2222
},
23-
plugins: [pluginHotRestart('restart')],
23+
plugins: [
24+
...(forgeEnv.forgeConfig.hotRestart ? [pluginHotRestart('restart')] : []),
25+
],
2426
define,
2527
resolve: {
2628
// Load the Node.js entry.

0 commit comments

Comments
 (0)