8000 fix: Rename PUBLIC environment variable to avoid problems with child_… · coder-long/electron-vite-react@4bb103c · GitHub
[go: up one dir, main page]

Skip to content

Commit 4bb103c

Browse files
fix: Rename PUBLIC environment variable to avoid problems with child_process (electron-vite#158)
* fix: Rename PUBLIC environment variable to avoid problems with child_process * chore: rename --------- Co-authored-by: 草鞋没号 <308487730@qq.com>
1 parent c9e3c81 commit 4bb103c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

electron/main/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { update } from './update'
1515
//
1616
process.env.DIST_ELECTRON = join(__dirname, '../')
1717
process.env.DIST = join(process.env.DIST_ELECTRON, '../dist')
18-
process.env.PUBLIC = process.env.VITE_DEV_SERVER_URL
18+
process.env.VITE_PUBLIC = process.env.VITE_DEV_SERVER_URL
1919
? join(process.env.DIST_ELECTRON, '../public')
2020
: process.env.DIST
2121

@@ -44,7 +44,7 @@ const indexHtml = join(process.env.DIST, 'index.html')
4444
async function createWindow() {
4545
win = new BrowserWindow({
4646
title: 'Main window',
47-
icon: join(process.env.PUBLIC, 'favicon.ico'),
47+
icon: join(process.env.VITE_PUBLIC!, 'favicon.ico'),
4848
webPreferences: {
4949
preload,
5050
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production

0 commit comments

Comments
 (0)
0