forge icon indicating copy to clipboard operation
forge copied to clipboard

Adding extra resources includes the entire local repository

Open msimoni18 opened this issue 2 years ago • 7 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.4.1

Electron version

26.1.0

Operating system

macOS 12.6.5

Last known working Electron Forge version

No response

Expected behavior

When including the following code in forge.config.ts, I expected to only see a folder called resources in process.resourcesPath.

packagerConfig: {
    extraResource: ['./resources'],
  },

Actual behavior

Instead, there is also a folder called app that contains the entire local repository, making the final package almost 1GB. Without extraResource, the app folder does not show up in process.resourcesPath.

Steps to reproduce

Add a folder in a top level directory, add that folder as an extraResource, then run electron-forge make.

Additional information

No response

msimoni18 avatar Sep 01 '23 03:09 msimoni18

no news here? @msimoni18 did you find a workaround?

elranu avatar Oct 24 '23 11:10 elranu

@elranu No, I haven't found any workaround. I think this may be the intended behavior.

msimoni18 avatar Oct 25 '23 00:10 msimoni18

Even without extraResources it copies the whole project folder into resources/app.

nicokimmel avatar Nov 01 '23 17:11 nicokimmel

@msimoni18 can you clarify if you're using a specific set of plugins/templates, or if this behaviour is reproducible with the base Forge config?

erickzhao avatar Nov 01 '23 20:11 erickzhao

@erickzhao I created a project using this template. Then I added a folder with some random files in a folder and added it as an extra resource in forge.config.ts. If you need me to, I can create a sample repo demonstrating this issue.

msimoni18 avatar Nov 02 '23 00:11 msimoni18

Can you upgrade @forge/plugin-vite to 7.3.0+ ?

caoxiemeihao avatar Apr 19 '24 16:04 caoxiemeihao

We have the same issue with the entire app folder copied including node_modules... Any progress or workaround?

BotellaA avatar Jul 20 '24 08:07 BotellaA

Might fold this into https://github.com/electron/forge/issues/3738

erickzhao avatar Feb 01 '25 00:02 erickzhao