Я программирую приложение с помощью vite, svelte@4, electron и electron-builder. если я запускаю Electron ./start-electron.js, логотип отображается, но после многих дней проб и ошибок я все еще не получаю его ни в упакованном приложении, ни в распакованном Linux, ни в файле .AppImage - только значки Wayland/X11 по умолчанию.
что мне не хватает? как я могу получить больше информации из процесса создания электронов?
мои конфигурации такие: package.json
import { app, BrowserWindow } from "electron/main";
import os from "node:os";
const doOpenDevTools = !app.isPackaged || app.commandLine.hasSwitch("defribbulate");
const isLinux = os.platform() == "linux";
function createWindow() {
const fnIcon = "dist/logo/bounce/256x256.png";
// Create the browser window
const mainWindow = new BrowserWindow({
width: 1200,
height: 800,
minWidth: 400,
minHeight: 400,
show: false,
icon: isLinux ? fnIcon : undefined,
});
mainWindow.removeMenu();
// and load the index.html of the app.
mainWindow.loadFile("./dist/index.html");
mainWindow.on("ready-to-show", mainWindow.show);
if (doOpenDevTools) {
// Open the DevTools.
mainWindow.webContents.openDevTools();
}
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
createWindow();
app.on("activate", function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", function () {
if (process.platform !== "darwin") {
app.quit();
}
});
});
Я программирую приложение с помощью vite, svelte@4, electron и electron-builder. если я запускаю Electron ./start-electron.js, логотип отображается, но после многих дней проб и ошибок я все еще не получаю его ни в упакованном приложении, ни в распакованном Linux, ни в файле .AppImage - только значки Wayland/X11 по умолчанию. что мне не хватает? как я могу получить больше информации из процесса создания электронов? мои конфигурации такие: [b]package.json[/b] [code]{ // name and homepage... "version": "2.0.0", "private": true, "type": "module", "main": "./start-electron.js", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json", "electron": "electron ./start-electron.js", "package": "npm run build && electron-builder --config electron-builder.ts", "package-multiplatform": "npm run build && electron-builder --win --linux --config electron-builder.ts" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tsconfig/svelte": "^5.0.5", "@types/three": "^0.179.0", "electron": "^32.1.2", "electron-builder": "^25.0.5", "prettier": "3.6.2", "svelte": "^4.2.19", "svelte-check": "^4.3.3", "tslib": "^2.8.1", "typescript": "^5.9.3", "vite": "^5.4.10", "vite-plugin-static-copy": "^3.1.4", "vite-tsconfig-paths": "^5.1.4", "html2canvas": "^1.4.1", "staffelei": "file:Staffelei", "three": "^0.180.0" } } [/code] [b]start-elextron.js[/b] [code]import { app, BrowserWindow } from "electron/main"; import os from "node:os";
// and load the index.html of the app. mainWindow.loadFile("./dist/index.html");
mainWindow.on("ready-to-show", mainWindow.show);
if (doOpenDevTools) { // Open the DevTools. mainWindow.webContents.openDevTools(); } }
// This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.whenReady().then(() => { createWindow();
app.on("activate", function () { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (BrowserWindow.getAllWindows().length === 0) { createWindow(); } });
// Quit when all windows are closed, except on macOS. There, it's common // for applications and their menu bar to stay active until the user quits // explicitly with Cmd + Q. app.on("window-all-closed", function () { if (process.platform !== "darwin") { app.quit(); } }); });
[/code] [b]electron-builder.ts[/b] [code]import { Configuration } from "electron-builder";