'Why does electron-builder include my whole project folder in app.asar?

When I extract the app.asar inside the builded Mac app with:

npx asar extract app.asar destfolder

I can see that it includes mostly everything which is in my project folder.

How can I exclude the files from app.asar?

This are parts of my package.json: (because its too much code for stackoverflow)

"directories": {
      "buildResources": "resources"
    },
    "extraResources": [
      "./content/**",
      "settings.json",
      {
        "from": "resources/icon.png",
        "to": ""
      },
      {
        "from": "resources/${os}",
        "to": "../"
      },
      {
        "from": "binaries/${os}",
        "to": "binaries",
        "filter": [
          "**/*"
        ]
      }
    ]

This is my project folder:

enter image description here

And this is the content of the builded app.asar file:

enter image description here



Solution 1:[1]

It seems I have to exclude every folder I dont want in the app.asar in the build section of the package.json like this:

"build": {
"files": [
  "!binaries/**/*",
  "!mac-build/**/*"
],

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 midnight-coding