-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support including node_modules in other subdirectories (#8562)
fix #6080 and support including node_modules in other subdirectories **How to fix** 1. No file patterns - The final File patterns are `["**/*", "!**/node_modules/**", "!dist{,/**/*}", ...] ` 2. File patterns with other sub node_modules `["/*", "**/sub/node_modules/**"]` - File patterns are `["**/*", "!**/node_modules/**", "**/sub/node_modules/**", "!dist{,/**/*}", ...]` 3. File patterns without sub node_modules - The final File patterns are `["**/*", "!**/node_modules/**", "!dist{,/**/*}", ...]` The final patterns above all filter out the node_modules in the app root directory. In filter.ts, we handle this by returning false by default if relative === 'node_modules', so it won't be filtered out. /~https://github.com/electron-userland/electron-builder/blob/e2c79819751454dbd1a939610d66e940b5dfb73d/packages/app-builder-lib/src/util/filter.ts#L60-L62 However, if you really want to filter out the node_modules in the app directory, you can use `["!node_modules/**/*"]` to filter it. **Two points to note** 1. Now `["**/*", "**/sub/node_modules"]` cannot match. Only `["**/*", "**/sub/node_modules/**"]` will match. For a relative path of` sub/node_modules`, if don't add a `/ ` at the end, we can only use `**/sub/node_module` to match. If add a `/` at the end, we can only use `**/sub/node_module/**` to match. **I currently prefer that `**/sub/node_modules/**` matches, as this aligns more with conventional usage.** 2. `*/sub/node_modules/**` cannot match because the relative path is `sub/node_modules`, and there's no extra directory at the beginning. --------- Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
- Loading branch information
Showing
9 changed files
with
131 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"app-builder-lib": major | ||
"builder-util": major | ||
--- | ||
|
||
support including node_modules in other subdirectories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters