Electron-packager: Not ignoring output directories results in larger bundles

Created on 27 Sep 2015  路  9Comments  路  Source: electron/electron-packager

I've created a simple app that just loads an url with some extra. I only need:

  • app
  • browser-window
  • global-shortcut
  • dialog
  • fs
  • https
  • menu

My package.json is really simple:

{
  "name": "myapp",
  "version": "0.0.1",
  "main": "main.js",
  "devDependencies": {
    "electron-prebuilt": "^0.33.3"
  }
}

How is it possible that my bundle osx app is more than 100MB, Linux > 500 and Windows over 1GB? What am I doing wrong?

Most helpful comment

I'm going to guess you have the same problem as #139, that you've ended up including your output folder in subsequent electron-packager runs. Try adding it to --ignore.

All 9 comments

I'm going to guess you have the same problem as #139, that you've ended up including your output folder in subsequent electron-packager runs. Try adding it to --ignore.

That worked @kfranqueiro !

Now al the build sizes are close to 100MB, any way to reduce that?

Hm. Are you sure you aren't also accidentally including an electron directory from development? Electron itself is usually ~40-50MB I think...

~100MB is about right. I just checked my app (Electron 0.26.0):

$ du -xcsh *
8.7M    content_shell.pak
53M AppFormerlyKnownAsElectron
9.8M    icudtl.dat
2.5M    libffmpegsumo.so
508K    libgcrypt.so.11
16M libnode.so
32K libnotify.so.4
404K    natives_blob.bin
2.4M    resources
908K    snapshot_blob.bin
93M total

Thanks @malept !

WTF why is my Electron application 4.5 GB in size!??

@coreybruce You're likely not ignoring files/directories that should be ignored when building the final product, or maybe there's a symlink to another directory that's large, or it could be some other problem. It's hard to tell without an example. If you go to one of the community sites, they'll be more people to help you with your problem.

I think I fixed it but that thanks for the heads up.

Hm. Are you sure you aren't also accidentally including an electron directory from development? Electron itself is usually ~40-50MB I think...

https://github.com/electron-webapps/meteor-electron/issues/97

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NoahAndrews picture NoahAndrews  路  5Comments

rafaelcastrocouto picture rafaelcastrocouto  路  3Comments

dland512 picture dland512  路  5Comments

Write-Guy picture Write-Guy  路  3Comments

leanderBehr picture leanderBehr  路  3Comments