使用电子生成器时出现问题,控制台出现空白页和错误:
Not allowed to load local resource: file:///C:/Users/emretekince/Desktop/DCSLogBook/client/dist/win-unpacked/resources/app.asar/build/index.html
main.js
const startUrl = process.env.ELECTRON_START_URL || url.format({ pathname: path.join(__dirname, '/build/index.html'), protocol: 'file:', slashes: true }); mainWindow.loadURL(startUrl);
通过在package.json中添加“文件”来解决
"files": [ "*.js", "build", "node_modules" ],