|
|
@ -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,6 +62,8 @@ function createWindow() { |
|
|
|
callback({}); // No redirect for other URLs
|
|
|
|
}, |
|
|
|
); |
|
|
|
|
|
|
|
if (isDev) { |
|
|
|
// Debug info
|
|
|
|
console.log("Debug Info:"); |
|
|
|
console.log("Running in dev mode:", isDev); |
|
|
@ -72,11 +72,15 @@ function createWindow() { |
|
|
|
console.log("App path:", app.getAppPath()); |
|
|
|
console.log("__dirname:", __dirname); |
|
|
|
console.log("process.cwd():", process.cwd()); |
|
|
|
} |
|
|
|
|
|
|
|
const indexPath = path.join(__dirname, "www", "index.html"); |
|
|
|
|
|
|
|
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}`); |
|
|
|