ESM 패키지 번들링 + electron-rebuild + import 수정
- electron-vite: nanoid/electron-store를 externalize 제외 (ESM 전용 번들 포함) - electron-rebuild: better-sqlite3/uiohook-napi Electron용 리빌드 - bootstrap: 동적 require → 정적 import으로 수정
This commit is contained in:
parent
f131b581a9
commit
5ccbf85a65
2 changed files with 5 additions and 7 deletions
|
|
@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
main: {
|
main: {
|
||||||
plugins: [externalizeDepsPlugin()],
|
plugins: [externalizeDepsPlugin({ exclude: ['nanoid', 'electron-store'] })],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@shared': resolve('src/shared')
|
'@shared': resolve('src/shared')
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { getHotkeyService } from './services/HotkeyService'
|
||||||
import { getVoiceModeService } from './services/VoiceModeService'
|
import { getVoiceModeService } from './services/VoiceModeService'
|
||||||
import { getLocalLLMService } from './services/LocalLLMService'
|
import { getLocalLLMService } from './services/LocalLLMService'
|
||||||
import { getHistoryService } from './services/HistoryService'
|
import { getHistoryService } from './services/HistoryService'
|
||||||
|
import { getTextInsertService } from './services/TextInsertService'
|
||||||
import { initDatabase } from './db'
|
import { initDatabase } from './db'
|
||||||
import {
|
import {
|
||||||
createMainWindow,
|
createMainWindow,
|
||||||
|
|
@ -168,17 +169,14 @@ async function initLLMPolling(): Promise<void> {
|
||||||
// ── HistoryPopup IPC 연동 ────────────────────────────
|
// ── HistoryPopup IPC 연동 ────────────────────────────
|
||||||
|
|
||||||
function setupHistoryPopupIPC(): void {
|
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
|
const entries = getHistoryService().list({ page: 0, pageSize: 10 }).entries
|
||||||
showHistoryPopup(entries as unknown as Array<Record<string, unknown>>)
|
showHistoryPopup(entries as unknown as Array<Record<string, unknown>>)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 아이템 선택 → 텍스트 삽입
|
// 아이템 선택 → 텍스트 삽입
|
||||||
ipcMain.on('history:itemSelected', (_event: Electron.IpcMainEvent, data: { text: string }) => {
|
ipcMainRef.on('history:itemSelected', (_event: Electron.IpcMainEvent, data: { text: string }) => {
|
||||||
hideHistoryPopup()
|
hideHistoryPopup()
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -190,7 +188,7 @@ function setupHistoryPopupIPC(): void {
|
||||||
})
|
})
|
||||||
|
|
||||||
// 팝업 닫기
|
// 팝업 닫기
|
||||||
ipcMain.on('history:popupDismissed', () => {
|
ipcMainRef.on('history:popupDismissed', () => {
|
||||||
hideHistoryPopup()
|
hideHistoryPopup()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue