electron package: reduce the package size

前端 未结 2 1296
终归单人心
终归单人心 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条回答
  •  忘了有多久
    2021-02-03 23:41

    You can reduce the electron app size by packaging using electron-builder package.

    PicArt is an electronjs app which I developed recently. It is built using reactJS. Initially when I packaged the app using electron-packager the Window's build size was around 98 MB. Then I found this awesome boilerplate electron-react where they configured the electron-builder to produced optimised build size. After using those configuration setup, PicArt's build is now around 36 MB.

    Yes, it is possible to reduce the app size , but it quite painful and time consuming to configure the build setup.

提交回复
热议问题