diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 7fd460e..0ea5795 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react' export default defineConfig({ main: { - plugins: [externalizeDepsPlugin()], + plugins: [externalizeDepsPlugin({ exclude: ['nanoid', 'electron-store'] })], resolve: { alias: { '@shared': resolve('src/shared') diff --git a/src/main/bootstrap.ts b/src/main/bootstrap.ts index 3078770..5a81cfd 100644 --- a/src/main/bootstrap.ts +++ b/src/main/bootstrap.ts @@ -7,6 +7,7 @@ import { getHotkeyService } from './services/HotkeyService' import { getVoiceModeService } from './services/VoiceModeService' import { getLocalLLMService } from './services/LocalLLMService' import { getHistoryService } from './services/HistoryService' +import { getTextInsertService } from './services/TextInsertService' import { initDatabase } from './db' import { createMainWindow, @@ -168,17 +169,14 @@ async function initLLMPolling(): Promise { // ── HistoryPopup IPC 연동 ──────────────────────────── function setupHistoryPopupIPC(): void { - const { ipcMain } = require('electron') - const { getTextInsertService } = require('./services/TextInsertService') - // 히스토리 팝업 열기 (핫키에서 호출) - ipcMain.on('history:showPopup', () => { + ipcMainRef.on('history:showPopup', () => { const entries = getHistoryService().list({ page: 0, pageSize: 10 }).entries showHistoryPopup(entries as unknown as Array>) }) // 아이템 선택 → 텍스트 삽입 - ipcMain.on('history:itemSelected', (_event: Electron.IpcMainEvent, data: { text: string }) => { + ipcMainRef.on('history:itemSelected', (_event: Electron.IpcMainEvent, data: { text: string }) => { hideHistoryPopup() setTimeout(async () => { try { @@ -190,7 +188,7 @@ function setupHistoryPopupIPC(): void { }) // 팝업 닫기 - ipcMain.on('history:popupDismissed', () => { + ipcMainRef.on('history:popupDismissed', () => { hideHistoryPopup() }) }