Skip to content

chore: update Vite config to include main process files in watch mode#99

Merged
KazeKaze93 merged 1 commit intomasterfrom
dx/electron-main-hmr
Apr 28, 2026
Merged

chore: update Vite config to include main process files in watch mode#99
KazeKaze93 merged 1 commit intomasterfrom
dx/electron-main-hmr

Conversation

@KazeKaze93
Copy link
Copy Markdown
Owner

  • Modified the Vite configuration to ensure that the main process files in src/main/** are included in the watch mode during development, enhancing the development experience by allowing for immediate feedback on changes.
  • Cleaned up unused imports and ensured adherence to strict coding standards throughout the changes.

- Modified the Vite configuration to ensure that the main process files in `src/main/**` are included in the watch mode during development, enhancing the development experience by allowing for immediate feedback on changes.
- Cleaned up unused imports and ensured adherence to strict coding standards throughout the changes.
@KazeKaze93 KazeKaze93 merged commit b6acc3f into master Apr 28, 2026
1 of 2 checks passed
@github-actions
Copy link
Copy Markdown

🛡️ Архитектор (AI Review)

⚠️ Надо исправить

Слишком узкий паттерн include в Watch-режиме

+            include: "src/main/**",

Ты ограничиваешь наблюдатель только папкой src/main/**. В серьезной архитектуре Electron-приложения Main-процесс неизбежно импортирует типы, константы или утилиты из src/shared или src/common.

Если ты изменишь контракт IPC-сообщения в src/shared/types.ts, Renderer обновится, а Main-процесс — нет, потому что Vite проигнорирует изменения вне src/main. Это гарантированный способ поймать "призрачный" баг при разработке.

Как исправить:
Либо оставь пустой объект {} (Vite по умолчанию отслеживает все файлы в графе зависимостей input), либо расширь массив путей, если хочешь явного контроля:

watch: isDevelopment
  ? {
      include: ["src/main/**", "src/shared/**"],
    }
  : undefined,

💡 Совет

В electron-vite конфиг для Main обычно не требует ручного перечисления include, так как Rollup под капотом строит дерево зависимостей от твоего input. Если ты добавил это, потому что что-то не подхватывалось — значит, у тебя проблемы с импортами или структурой проекта. Не лечи симптомы, лечи причину.

Analyzed by: gemini-3-flash-preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant