I am trying to build an electron app with some functionality.But it size becomes 2.1 GB when i build an app using npx electron - builder.
I have modified my package to remove unused dependencies.But did not get any luck. I also used "compression":"maximum" but it only increase the size but no luck
const axios = require('axios');
var fs = require('fs');
const BrowserWindow = electron.BrowserWindow
let win;
function createWindow() {
//create window with some context-menus
}
app.on("ready", createWindow);
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
});
app.on("activate", () => {
if (win === null) {
createWindow();//Create window
}
});
ipcMain.on('getFiles', async(event, arg) => {
//check file and read its content
win.webContents.send("getFilesResponse", JSON.parse(fileData.toString()));
} else {
//get makeaddress and send this random string to node server. It will return some data and save it to file on local machine. Return the response.
win.webContents.send("getFilesResponse", response.data.data);
} catch (err) {}
}
});
function makeaddress(length, type = 'random') {
return some-random-string;
}
Size should not be greater than 200 MB.