mirror of
https://github.com/actualbudget/actual.git
synced 2026-05-29 07:31:22 -05:00
Bundle sizes are unchanged but now we no longer pull in the Electron-specific FS code on the web version
31 lines
821 B
JavaScript
31 lines
821 B
JavaScript
require('./setRequireHook');
|
|
require('module').globalPaths.push(__dirname + '/..');
|
|
|
|
global.fetch = require('node-fetch');
|
|
|
|
// Lazy load backend code
|
|
function getBackend() {
|
|
// eslint-disable-next-line import/extensions
|
|
return require('loot-core/lib-dist/bundle.desktop.js');
|
|
}
|
|
|
|
if (process.argv[2] === '--subprocess') {
|
|
let isDev = false;
|
|
// let version = process.argv[3];
|
|
let socketName = process.argv[4];
|
|
|
|
// Start the app
|
|
getBackend().initApp(isDev, socketName);
|
|
} else if (process.argv[2] === '--standalone') {
|
|
require('source-map-support').install();
|
|
getBackend().initApp(true, 'actual-standalone');
|
|
} else {
|
|
let { ipcRenderer } = require('electron');
|
|
let isDev = true;
|
|
|
|
ipcRenderer.on('set-socket', (event, { name }) => {
|
|
// Start the app
|
|
getBackend().initApp(isDev, name);
|
|
});
|
|
}
|