electron package: reduce the package size

前端 未结 2 1293
终归单人心
终归单人心 2021-02-03 23:08

I made a simple Electron app:

main.js

const {app, BrowserWindow} = require(\'electron\')
const path = require(\'path\')
const url = require(\'ur         


        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-03 23:45

    I managed to reduce the final size of my mac app from 250MB to 128MB by moving 'electron' and my reactJs dependencies to devDependencies in package.json ... since all I need is going to be in the final bundle.js

    But sadly I couldn't get it any lower than that because the electron framework is 118MB which is something if you're making a small app, but I guess that's the price to pay for making cross-platform web apps

提交回复
热议问题