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

fix build configuration for packaged app #22

Open
3 tasks
achou11 opened this issue Jul 2, 2024 · 0 comments
Open
3 tasks

fix build configuration for packaged app #22

achou11 opened this issue Jul 2, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@achou11
Copy link
Member

achou11 commented Jul 2, 2024

Extracted from #18. That PR introduces changes that generally work fine in development, but when building the archive we run into some issues.

Currently, when packaging the app, all packages that are specified as deps are copied over into the packaged application (and live in the node_modules directory). this is built-in behavior of the vite plugin and as of right now, there is no way to change this (see electron/forge#3570). this results in a rather bloated package size because it essentially copies over a good portion of the node_modules directory into the archive when it's not necessary to do so. We'll need to adjust the vite configuration to account for this (which was originally mostly taken from a template that they provide, with some adjustments based on issues i found):

  • update the build.rollupOptions.externals field to make sure that only native modules or builtins (e.g. electron) are not bundled
  • patch the vite plugin to disable the "copy over all deps" behavior
  • make sure that necessary static assets are included when building the app
    • e.g. offline map, default config, drizzle
@achou11 achou11 self-assigned this Jul 2, 2024
@achou11 achou11 added the bug Something isn't working label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant