electronelectron-packager

electron-packager is packing with old version files


I have an Electron+Angular application.

When I build the Angular app, it goes to dist folder, ok. And when I use electron-packager and electron-builder, it put the files inside dist too.

For the first version it's ok. The problem is when I'm building a second version. It packs the old version files that is inside dist folder. And the result is a large .exe file.

These is the commands I'm using to pack and publish my app:

electron-packager . --overwrite --asar=true --platform=win32 --ignore=ˆ/tmp

electron-builder --publish always

How can I prevent the old version files to be packed in new versions? Should I remove them every time I build a new version?


Solution

  • I finally solved my problem

    I'm new with Electron, so I though that run electron-packager was necessary before publish new versions.

    You only need to run:

    electron-builder --publish always
    

    electron-packager packs everything inside dist folder and creates a new folder outside dist.

    electron-builder create necessary files to publish but ignores the old version files that was created for it. But if you have that new folder created by electron-packager it'll be published too and your .exe will be very large.