Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 2a524b4

Browse files
committed
빌드시 electron-builder.json 파일 복제
자동으로 electron-builder.json 제거로 인한 파일 복제 처리
1 parent cc63b18 commit 2a524b4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import { app, BrowserWindow, Menu, nativeImage, Tray } from 'electron';
22

33
import { join } from 'path';
44

5-
import { productName, protocols } from '../electron-builder.json';
65
import { globImport } from './utils/import';
76

87
export type AppContextType = InstanceType<typeof AppContext>;
98
export type ModuleFunction = (context: AppContextType) => void | Promise<void>;
109

10+
const { productName, protocols } = require(app.isPackaged
11+
? './app.json'
12+
: '../electron-builder.json');
13+
1114
class AppContext {
1215
// deep link protocol
1316
readonly PROTOCOL = protocols.name;

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react';
33
import path from 'path';
44
import { defineConfig } from 'vite';
55
import electron from 'vite-electron-plugin';
6-
import { alias } from 'vite-electron-plugin/plugin';
6+
import { alias, copy } from 'vite-electron-plugin/plugin';
77
import checker from 'vite-plugin-checker';
88
import tsconfigPaths from 'vite-tsconfig-paths';
99

@@ -21,6 +21,7 @@ export default defineConfig({
2121
replacement: path.join(__dirname, 'app'),
2222
},
2323
]),
24+
copy([{ from: 'electron-builder.json', to: 'dist-electron/app.json' }]),
2425
],
2526
}),
2627
],

0 commit comments

Comments
 (0)