Skip to content

Use of extraResources prevents node_modules from being included in asar #867

@gerges-zz

Description

@gerges-zz
  • Version: 7.14.1
  • Target: OSX

When using the extraResources JSON object option, the node_modules is never included in the asar. This issue is caused by a change recently made to filter.ts (the inclusion of stat.isDirectory() in the following line)

match = pattern.match(path, stat.isDirectory() && !pattern.negate)

The extraResources results in a excludePatterns array being built up, which eventually is used to filter files (incorrectly) in the following line createFilter (filter.ts )

return minimatchAll(relative, patterns, stat) && (excludePatterns == null || !minimatchAll(relative, excludePatterns, stat))

I believe Instead of using !minimatchAll (which is triggering the stat.isDirectory() case) this issue could be resolved by creating the excludePatterns as negated globs (instead of negating the result of attempting to filter)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions