mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 14:44:25 +01:00
fix(desktop/esbuild): asset path not working at runtime
This commit is contained in:
parent
64b4869939
commit
43d9f77518
@ -9,8 +9,6 @@ import escape from "escape-html";
|
|||||||
import sanitize from "sanitize-filename";
|
import sanitize from "sanitize-filename";
|
||||||
import mimeTypes from "mime-types";
|
import mimeTypes from "mime-types";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import { dirname, join } from "path";
|
|
||||||
import type NoteMeta from "./meta/note_meta.js";
|
import type NoteMeta from "./meta/note_meta.js";
|
||||||
import log from "./log.js";
|
import log from "./log.js";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
@ -299,7 +297,7 @@ export function getResourceDir() {
|
|||||||
return path.dirname(process.argv[1]);
|
return path.dirname(process.argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return join(dirname(fileURLToPath(import.meta.url)), "..");
|
return path.join(__dirname, "..");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Deduplicate with src/public/app/services/utils.ts
|
// TODO: Deduplicate with src/public/app/services/utils.ts
|
||||||
|
|||||||
@ -10,10 +10,8 @@ import keyboardActionsService from "./keyboard_actions.js";
|
|||||||
import electron from "electron";
|
import electron from "electron";
|
||||||
import type { App, BrowserWindowConstructorOptions, BrowserWindow, WebContents } from "electron";
|
import type { App, BrowserWindowConstructorOptions, BrowserWindow, WebContents } from "electron";
|
||||||
import { formatDownloadTitle, isDev, isMac, isWindows } from "./utils.js";
|
import { formatDownloadTitle, isDev, isMac, isWindows } from "./utils.js";
|
||||||
|
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import { dirname } from "path";
|
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
|
import { RESOURCE_DIR } from "./resource_dir.js";
|
||||||
|
|
||||||
// Prevent the window being garbage collected
|
// Prevent the window being garbage collected
|
||||||
let mainWindow: BrowserWindow | null;
|
let mainWindow: BrowserWindow | null;
|
||||||
@ -259,7 +257,7 @@ async function configureWebContents(webContents: WebContents, spellcheckEnabled:
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getIcon() {
|
function getIcon() {
|
||||||
return path.join(dirname(fileURLToPath(import.meta.url)), "../../images/app-icons/png/256x256" + (isDev ? "-dev" : "") + ".png");
|
return path.join(RESOURCE_DIR, "images/app-icons/png/256x256" + (isDev ? "-dev" : "") + ".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createSetupWindow() {
|
async function createSetupWindow() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user