chore: update in preparation for production mode

This commit is contained in:
Matthew Raymer
2025-02-13 07:29:08 +00:00
parent 16bc47921d
commit 12025d6f21
3 changed files with 61 additions and 32 deletions

View File

@@ -39,7 +39,6 @@ function createWindow() {
},
(details, callback) => {
let url = details.url;
console.log("Intercepting asset request:", url);
// Handle paths that don't start with file://
if (!url.startsWith("file://") && url.includes("/assets/")) {
@@ -56,7 +55,6 @@ function createWindow() {
: `file://${__dirname}`;
const assetPath = url.split("/assets/")[1];
const newUrl = `${baseDir}/www/assets/${assetPath}`;
console.log("Redirecting to:", newUrl);
callback({ redirectURL: newUrl });
return;
}
@@ -64,19 +62,25 @@ function createWindow() {
callback({}); // No redirect for other URLs
},
);
// Debug info
console.log("Debug Info:");
console.log("Running in dev mode:", isDev);
console.log("App is packaged:", app.isPackaged);
console.log("Process resource path:", process.resourcesPath);
console.log("App path:", app.getAppPath());
console.log("__dirname:", __dirname);
console.log("process.cwd():", process.cwd());
if (isDev) {
// Debug info
console.log("Debug Info:");
console.log("Running in dev mode:", isDev);
console.log("App is packaged:", app.isPackaged);
console.log("Process resource path:", process.resourcesPath);
console.log("App path:", app.getAppPath());
console.log("__dirname:", __dirname);
console.log("process.cwd():", process.cwd());
}
const indexPath = path.join(__dirname, "www", "index.html");
console.log("Loading index from:", indexPath);
console.log("www path:", path.join(__dirname, "www"));
console.log("www assets path:", path.join(__dirname, "www", "assets"));
if (isDev) {
console.log("Loading index from:", indexPath);
console.log("www path:", path.join(__dirname, "www"));
console.log("www assets path:", path.join(__dirname, "www", "assets"));
}
if (!fs.existsSync(indexPath)) {
console.error(`Index file not found at: ${indexPath}`);