question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to exclude files from app.asar

See original GitHub issue
  • Version: 20.28.4 and
  • Target: all, but specifically I am currently testing mac

On my project the ability to excludes files by annotating them under the build section in package.json was working.

After adding electron-webpack. This now no longer works. I am seeing everything included in my app.asar file. I have attempted to exclude electron-webpack from my build process and only run electron-build, but I still see everything in app.asar. Here is my debug log from running DEBUG=electron-builder npm run pack

"pack": "electron-builder --dir",
directories:
  output: dist
  buildResources: src/assets
extraMetadata:
  main: main.js
files:
  - from: .
    filter:
      - package.json
      - '**/*'
      - src
      - '!webpack*'
      - '!.*'
      - '!config/jsdoc.json'
      - '!package.json'
      - '!docs'
      - '!private'
  - from: dist/main
  - from: dist/renderer
  - from: dist/renderer-dll
extraResources:
  - from: src/assets
    to: assets
    filter:
      - '!track*'
      - '!css'
appId: com.test.test
productName: Test Desktop
copyright: '© 2018 Test, LLC.'
artifactName: '${name}-${version}-${os}-${arch}.${ext}'
publish:
  - provider: s3
    bucket: xxx
    storageClass: STANDARD_IA
    path: '${channel}/${os}'
  - provider: github
    owner: xxx
    repo: xxx
linux:
  files:
    - '!node_modules/@ffprobe-installer/darwin-x64/${/*}'
    - '!node_modules/@ffprobe-installer/win32-ia32/${/*}'
    - '!node_modules/@ffprobe-installer/win32-x64/${/*}'
    - '!node_modules/@ffmpeg-installer/darwin-x64/${/*}'
    - '!node_modules/@ffmpeg-installer/win32-ia32/${/*}'
    - '!node_modules/@ffmpeg-installer/win32-x64/${/*}'
  category: AudioVideoEditing
  description: Test desktop video processing and file uploader
  icon: src/assets/icon.png
  desktop:
    Name: Test-Desktop
    GenericName: Test Desktop
    X-GNOME-FullName: test-desktop
    Comment: Test desktop video processing and file uploader
    Type: Application
    Terminal: 'false'
    StartupNotify: 'false'
    Categories: AudioVideoEditing
mac:
  files:
    - '!node_modules/@ffprobe-installer/linux-ia32/${/*}'
    - '!node_modules/@ffprobe-installer/linux-x64/${/*}'
    - '!node_modules/@ffprobe-installer/win32-ia32/${/*}'
    - '!node_modules/@ffprobe-installer/win32-x64/${/*}'
    - '!node_modules/@ffmpeg-installer/linux-ia32/${/*}'
    - '!node_modules/@ffmpeg-installer/linux-x64/${/*}'
    - '!node_modules/@ffmpeg-installer/win32-ia32/${/*}'
    - '!node_modules/@ffmpeg-installer/win32-x64/${/*}'
  category: public.app-category.video
win:
  files:
    - '!node_modules/@ffprobe-installer/linux-ia32/${/*}'
    - '!node_modules/@ffprobe-installer/linux-x64/${/*}'
    - '!node_modules/@ffprobe-installer/darwin-x64/${/*}'
    - '!node_modules/@ffmpeg-installer/linux-ia32/${/*}'
    - '!node_modules/@ffmpeg-installer/linux-x64/${/*}'
    - '!node_modules/@ffmpeg-installer/darwin-x64/${/*}'
  certificateFile: private/test.pfx
  verifyUpdateCodeSignature: false
  publisherName: trackops
extends: electron-webpack/electron-builder.yml
electronVersion: 3.0.7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
joernroedercommented, Dec 22, 2018

i’m also having the issue! in my package.json i’m limiting files to a folder with precompiled files (via webpack) and an assets folder

"files": [
      "dist/electron/**/*",
      "assets/core/**/*"
    ],

which results in yaml:

files:
  - filter:
      - dist/electron/**/*
      - assets/core/**/*

but my whole repo gets bundled into the app. i’m on macOS, electron-builder is 20.38.4

1reaction
develarcommented, Nov 4, 2018

It seems bug in the merge parent and project configs. I will take a look tomorrow morning CET.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exclude some folders, while doing electron-packager . --asar
Is it possible to exclude some of folders? Yes, you can do it with ignore. You can use --ignore to ignore files and...
Read more >
Common Configuration - electron-builder
asarUnpack Array<String> | String | “undefined” - A glob patterns relative to the app directory, which specifies which files to unpack when creating...
Read more >
Options | electron-packager
Ignores system junk files when copying the Electron app, regardless of the ignore option. Note: junk will have no effect if the prebuiltAsar...
Read more >
asar | Yarn - Package Manager
Asar is a simple extensive archive format, it works like tar that concatenates all files together without compression, while having random access support....
Read more >
Configuration - Electron Forge
If you do not have config.forge set in your package.json file, Forge will attempt ... is the Electron Forge configuration associated with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found