Skip to content

Commit

Permalink
udpate main matcher patterns in node modules file sets
Browse files Browse the repository at this point in the history
  • Loading branch information
Payne Fu authored and Payne Fu committed Jun 16, 2024
1 parent 5f2c143 commit a97efec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/app-builder-lib/src/util/appFileCopier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export async function computeNodeModuleFileSets(platformPackager: PlatformPackag
for (const info of deps) {
const source = info.dir
const destination = path.join(mainMatcher.to, NODE_MODULES, info.name)
const matcher = new FileMatcher(platformPackager.info.appDir, destination, mainMatcher.macroExpander, mainMatcher.patterns)
// use main matcher patterns, so, user can exclude some files !node_modules/xxxx
const matcher = new FileMatcher(path.dirname(path.dirname(source)), destination, mainMatcher.macroExpander, mainMatcher.patterns)
const copier = new NodeModuleCopyHelper(matcher, platformPackager.info)
const files = await copier.collectNodeModules(info, nodeModuleExcludedExts)
result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })
Expand All @@ -201,7 +202,7 @@ export async function computeNodeModuleFileSets(platformPackager: PlatformPackag
for (const dep of info.conflictDependency) {
const source = dep.dir
const destination = path.join(mainMatcher.to, NODE_MODULES, info.name, NODE_MODULES, dep.name)
const matcher = new FileMatcher(platformPackager.info.appDir, destination, mainMatcher.macroExpander, mainMatcher.patterns)
const matcher = new FileMatcher(path.dirname(path.dirname(source)), destination, mainMatcher.macroExpander, mainMatcher.patterns)
const copier = new NodeModuleCopyHelper(matcher, platformPackager.info)
result[index++] = validateFileSet({ src: source, destination, files: await copier.collectNodeModules(dep, nodeModuleExcludedExts), metadata: copier.metadata })
}
Expand Down

0 comments on commit a97efec

Please sign in to comment.