Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging / making with electron forge increase package size #655

Closed
4 tasks done
bennymeg opened this issue Jan 3, 2019 · 12 comments
Closed
4 tasks done

packaging / making with electron forge increase package size #655

bennymeg opened this issue Jan 3, 2019 · 12 comments

Comments

@bennymeg
Copy link

bennymeg commented Jan 3, 2019

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

I have migrated to electron-forge this week after using electron-packager & electron-winstaller for quite a long time. I have use electron-forge import and set all the packaging / installer settings as they was before the change. after that I have packages and created an installer of my application, the package size increased from 394MB to 588MB and the executable size increased from 120MB to 175MB.

Is it possible that the node_modules size increased that much? or is it an internal bug?

  • I have made sure that the output directory is out/ ant that is not included in the new package.

windows 10
node v8.11.1
electron-forge v5.2.3

What command line arguments am I passing?

electron-forge package
electron-forge make

What are the dependencies changes in package.json look like?

"dependencies": {
+    "electron-compile": "^6.4.4"
},
"devDependencies": {
+    "babel-plugin-transform-async-to-generator": "^6.24.1",
+    "babel-preset-env": "^1.7.0",
+    "babel-preset-react": "^6.24.1",
+    "electron-forge": "^5.2.3",
+    "electron-prebuilt-compile": "3.0.13",
-     "electron": "^3.0.13",
-     "electron-packager": "^12.2.0",
-     "electron-winstaller": "^2.7.0",
}

What does my config.forge data in package.json look like?

"config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "npm",
        "asar": true,
        "prune": true,
        "icon": "src/assets/icons/win/config.ico",
        "win32metadata": {
          "CompanyName": "name",
          "FileDescription": "decs",
          "ProductName": "name"
        }
      },
      "electronWinstallerConfig": {
        "name": "name",
        "authors": "me",
        "owners": "me",
        "noMsi": true,
        "setupIcon": "src/assets/icons/win/installer.ico",
        "iconUrl": "file:///C:/Users/me/Documents/name/src/assets/icons/win/config.ico"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "name"
      }
    }
@malept
Copy link
Member

malept commented Jan 3, 2019

Can you try using Electron Forge v6 instead?

@bennymeg
Copy link
Author

bennymeg commented Jan 3, 2019

Sure,

I have installed v6 globally: npm i -g @electron-forge/[email protected]
after that I executed electron-forge make I have got the following result:

My app was packaged but it seems that all my configuration was ignored (no asar, app icon, win32metadata), and it did not make executable.

Did the API have been changed?

@malept
Copy link
Member

malept commented Jan 3, 2019

Yes. I'm working on a simple v5 to v6 config importer: #653

@bennymeg
Copy link
Author

bennymeg commented Jan 3, 2019

Sorry, I didn't see that in the documentation.

I executed electron-forge import, updated to the same configurations but not much have been changed. Now the package size is 583MB and the executable size is 170MB.

@malept
Copy link
Member

malept commented Jan 3, 2019

It would help if we had access to a minimal testcase that also had this behavior, maybe starting with electron-quick-start.

Also, what do you mean by "executable size"? The size of the renamed electron.exe? The squirrel setup.exe file?

@bennymeg
Copy link
Author

bennymeg commented Jan 3, 2019

Also, what do you mean by "executable size"? The size of the renamed electron.exe? The squirrel setup.exe file?

Yes.

It would help if we had access to a minimal testcase that also had this behavior, maybe starting with electron-quick-start.

Would you like that I will clone electron-quick-start add the same configuration and report back the results?

@malept
Copy link
Member

malept commented Jan 3, 2019

Also, what do you mean by "executable size"? The size of the renamed electron.exe? The squirrel setup.exe file?
Yes.

Yes? Please explain further.

Would you like that I will clone electron-quick-start add the same configuration and report back the results?

Yes, please.

@bennymeg
Copy link
Author

bennymeg commented Jan 3, 2019

Yes? Please explain further.

Sorry, my bad,
Package size: the size of the entire package folder (the output of electron-packager).
Executable size: the size of the squirrel setup.exe file.

Would you like that I will clone electron-quick-start add the same configuration and report back the results?

Yes, please.

No problem

@bennymeg
Copy link
Author

bennymeg commented Jan 3, 2019

Package size: 120MB.
Executable size: 51.7MB.

@malept
Copy link
Member

malept commented Jan 3, 2019

Package size: 120MB.
Executable size: 51.7MB.

Are those numbers with Electron Packager + electron-winstaller, or as an imported Forge v6 project?

@bennymeg
Copy link
Author

bennymeg commented Jan 3, 2019

Are those numbers with Electron Packager + electron-winstaller, or as an imported Forge v6 project?'

As an imported Forge v6 project
I simply executed electron-forge import, added the configurations and then electron-forge make

@malept
Copy link
Member

malept commented Jan 4, 2019

As far as I can tell from making a .deb file with electron-installer-debian (because I don't own a Windows machine) and then importing electron-quick-start with Electron Forge v6, the only additions to the app footprint were electron-squirrel-startup and its only dependency, debug, which are expected. The space increase was less than 1MB.

With regards to Electron Forge v5, electron-compile comes at a cost of 11 packages and 2MB of uncompressed node_modules space.

So, without a minimal testcase that shows a 200MB+ increase in size when using Forge, I can't do much about it except speculate. I'm going to close this issue for now, but if you can provide said reproducible testcase, I can take a look at it and then we can decide whether to reopen.

@malept malept closed this as completed Jan 4, 2019
dsanders11 pushed a commit that referenced this issue Jan 14, 2023
…ing & downloading versions (#655)

* refactor: removeBinary() takes a RunnableVersion param

* refactor: removeVersion() takes a RunnableVersion

* refactor: downloadVersion() takes a RunnableVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants