Так что я пытаюсь сделать электронное приложение с угловым (версия Typescript), и оно вообще не запустится, я встроил Electron-log, который ничего не делает (поэтому я думаю, что он вообще не запускается).
const path = require('path');
const url = require('url');
const log = require('electron-log');
log.transports.file.level = 'debug';
log.transports.file.format = '{h}:{i}:{s}:{ms} {text}';
log.transports.file.file = __dirname + './log.txt';
log.transports.file.streamConfig = { flags: 'w'};
log.info('message');
// Keep a global reference of the window object, if we don't the window will be closed
// automagically when the JS object is Garbage Collected. (GC from here on out)
let win;
try {
const createWindow = () => {
// set timeout to render the window not until the Angular compiler is ready to show the project
//create the browser window
win = new BrowserWindow({
width: 800,
height: 600,
icon: path.join(__dirname, 'favicon.ico'),
});
//and load the app
win.loadURL(url.format({
pathname: path.join(__dirname, 'resources/app/angular-flask/index.html'),
protocol: 'file:',
slashes: true
}));
// Emitted when the window is closed
win.on('closed', () => {
// Dereference the window object
win = null;
});
};
// This method will be called when Electron has finished initialization and is ready to
// create browser windows . Some API's can only be used after this event happens.
app.on('ready', createWindow);
// Quit when all windows are closed
app.on('windows-all-closed', () => {
// On macOS applications might stay active untill user quits with cmd + Q
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
// On macOS sometimes a window is recreated when the dock icon is clicked and there are no other
// windows open
if (win === null) {
createWindow();
}
});
} catch(e) {
log.error(e)
}
Выше приведен мой код электронного производства, также доступный на pastebin Может кто-нибудь объяснить, почему это может произойти, и предложить решение?
РЕДАКТИРОВАТЬ: Этоне работал, прежде чем я интегрировал электронный журнал. Кроме того, угловой интерфейс работает, когда я запускаю его через облегченный сервер npx.
EDIT2: Вот мой Package.json и мой обновленный код main.js Electron.prod.js Также я использую электронный упаковщик.