From 405228f41754fe03d28922d644e32af2b8d5d2c6 Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:39:56 +0200 Subject: [PATCH] fix: build errors --- electron/index.ts | 7 +++---- package.json | 2 -- yarn.lock | 5 ----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/electron/index.ts b/electron/index.ts index c6d4ba0..4939b91 100644 --- a/electron/index.ts +++ b/electron/index.ts @@ -1,6 +1,5 @@ import * as path from 'node:path' import { app, BrowserWindow, dialog, ipcMain } from 'electron'; -import * as isDev from 'electron-is-dev'; import * as colorette from 'colorette'; import * as fs from 'node:fs' import * as os from 'node:os' @@ -19,10 +18,10 @@ function createWindow() { autoHideMenuBar: true, title: 'sern', }); - if (isDev) { - mainWindow.loadURL('http://localhost:5173'); - } else { + if (app.isPackaged) { mainWindow.loadFile(path.join(__dirname, '../build/index.html')); + } else { + mainWindow.loadURL('http://localhost:5173'); } mainWindow.on('ready-to-show', () => { diff --git a/package.json b/package.json index 42fe9c3..d1cbea1 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "@mui/icons-material": "^5.11.16", "@mui/material": "^5.13.4", "colorette": "^2.0.20", - "electron-is-dev": "^2.0.0", "i18next": "^23.4.4", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -50,7 +49,6 @@ "vite": "^4.4.0" }, "build": { - "extends": null, "files": [ "./build/**/*", "./dist/index.js" diff --git a/yarn.lock b/yarn.lock index 84b7995..7222af2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1801,11 +1801,6 @@ electron-builder@^24.4.0: simple-update-notifier "^1.1.0" yargs "^17.6.2" -electron-is-dev@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-2.0.0.tgz#833487a069b8dad21425c67a19847d9064ab19bd" - integrity sha512-3X99K852Yoqu9AcW50qz3ibYBWY79/pBhlMCab8ToEWS48R0T9tyxRiQhwylE7zQdXrMnx2JKqUJyMPmt5FBqA== - electron-publish@24.4.0: version "24.4.0" resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-24.4.0.tgz#a58f49ecd727620f65372881788ebb1a9b853284"