Unexpected behavior when trying to ignore folders during build (electron forge)

Ok so I am using TeamCity 2020.2 and the OS is windows server 2019 32bit. 

Software is Electron v27.1.0, Electron Forge v6.4.2 and Angular v15.

During packaging, unwanted folders and files are included, which drive up build time and package size (9 minutes and 165mb)

Electron builder allows you to ignore folders and files with an ignore option (uses regex) so that they are not included in the build.

This works on my local machine, where build time is 2 minutes

But on TeamCity, this ignore option has very weird results, it drives up the build time back to 9 minutes, and results in an .exe that is 200kb and a .nupkg file which is 1gb which is insane, they both are 100mb on my local

if I remove that ignore option from my configuration, and I add a build step that manually deletes the unwanted files. then total build time is indeed 2-3 minutes, and file size for both files is 100mb

I would like to make the ignore option work on teamcity, for streamlining the process between the local machines and teamcity, can anyone tell me why the option/regex isnt working on team city? I have tried different syntaxes for regex, but none seem to work, here is what my current options look like:



packagerConfig: {
  name: `appname`,
  icon: './icon',
  asar: true,
  arch: "ia32",
  platform: "win32",
  ignore: [/\/\.angular$/]

1 comment


The observed behavior is unusual. 

I would like to confirm whether it functions correctly on the agent machine. The reason for my inquiry is that I'm unsure whether the local machine is indeed the agent machine. Preferably, this check should be conducted under the same user.

You can follow the guidelines outlined in this document - Common Problems in TeamCity to check whether the issue is related to TeamCity or not?

If the behavior continues to differ within TeamCity, please create a new issue in our tracker detailing the case. Please attach all the build step settings, the build log, all agent logs covering the build, the command you used in the console to run the build and the full console output of the build.


Please sign in to leave a comment.