Glob Pattern Syntax
Basic Patterns
Extended Patterns
Using File Patterns
Including Files
Define which files to include in your application:package.json
If a directory is matched, all its contents are copied automatically. You can specify just
foo to copy the entire foo directory.Excluding Files
Use the! prefix to exclude files:
package.json
Excluding Directories
Solution: Use the${/*} macro:
Multiple Glob Patterns
Patterns are processed in order, allowing you to include exceptions to exclusions:File Macros
You can use macros in file patterns, artifact names, and publish URLs. Macros are replaced at build time.Available Macros
Using Macros in Patterns
package.json
Environment Variable Macros
electron-builder.yml
The
${ext} macro is also supported in artifact file name templates to represent the file extension.Common Patterns
Development vs Production Files
Exclude Source Files
Platform-Specific Resources
Include Build Resources
extraResources and extraFiles
For files that should not be in the app.asar archive:FileSet with Patterns
See Application Contents for more details on
extraResources and extraFiles.Performance Tips
- Be specific: Use specific patterns instead of broad patterns with many exclusions
- Exclude unnecessary files: Remove development files, documentation, and test files
- Use asarUnpack carefully: Unpacking too many files can slow down your app