problem description
I created the project with webpack-vue scaffolding, and after the development is complete, I need to adapt to multiple platforms, so I use electron-packager to package again. After packaging, I open the application. The js and css file paths introduced in index.html are all right, but the js file is not executed and the page is completely blank. Ask the gods how to solve this problem. The screenshot of the question is as follows:
the environmental background of the problems and what methods you have tried
this application can be launched on web, using webpack-dev "s server, and I have no problem launching desktop applications directly with electron. I wonder if I also need to launch a localhost server, after using electron to generate desktop applications, but I don"t know how to start such a server
.related codes
/ / Please paste the code text below (do not replace the code with pictures)
I am using double package.json, The main contents of package.json are as follows:
Packaging script:
"packager": "electron-packager. / dist VEEClient-- platform=darwin-- arch=x64-- overwrite-- prune-- overwrite"
"main": "electron.js"
electron.js is as follows:
const {app, BrowserWindow} = require ("electron")
const url = require (" url")
const path = require ("path")
let window;
function createWindow () {
window = new BrowserWindow({
title: "VEE Client",
height: 600,
width: 1000,
minHeight: 600,
minWidth: 800,
minimizable: true,
webPreferences: {
webSecurity: false
}
})
window.loadURL(url.format({
pathname: path.join(__dirname, "index.html"),
protocol: "file:",
slashes: true
}))
window.openDevTools()
window.on("close", () => {
window = null
})
}
app.on ("ready", createWindow)
app.on (" window-all-closed", () = > {
if (process.platform !== "darwin") {
app.quit()
}
})
app.on ("activate", () = > {
if (window === null) {
createWindow()
}
})
what result do you expect? What is the error message actually seen?
what I want is that the packaged application will have the same result after startup as it does after launching via Web.