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

Including the package increases the build size by ~15 MB #278

Open
ZimM-LostPolygon opened this issue Jan 17, 2024 · 0 comments
Open

Including the package increases the build size by ~15 MB #278

ZimM-LostPolygon opened this issue Jan 17, 2024 · 0 comments

Comments

@ZimM-LostPolygon
Copy link

ZimM-LostPolygon commented Jan 17, 2024

Describe the bug
Simply adding the package increases the build size by about 15 MB. It seems like the package drags along dev-only packages into production as part of node_modules. This negatively influences both the build size and the startup time.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Electron Forge + Vite project with npm init electron-app@latest my-new-app -- --template=vite-typescript
  2. Run yarn package. Observe the resources in the build being around 200 KB in size.
  3. Run yarn add @capacitor-community/electron then yarn package. Observe the resources in the build being around 15 MB in size.

Expected behavior
Since this package is basically a helper to glue Capacitor and Electron together, it shouldn't have any actual influence on the resulting build. Pretty much the only things normally used in runtime from the entire package are two lines:

import type { CapacitorElectronConfig } from '@capacitor-community/electron';
import { getCapacitorElectronConfig, setupElectronDeepLinking } from '@capacitor-community/electron';

Desktop (please complete the following information):

  • OS: Windows 11
  • Version 5.0.1

Additional context
Same happens when an Electron project is created with npx cap add @capacitor-community/electron.

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

1 participant