fix(build-utils): ignore the effects of directories when exclude files (#17654)

This commit is contained in:
qiang 2024-07-27 11:57:47 +08:00 committed by GitHub
parent 606ff06322
commit 8d154dfad8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,7 +31,8 @@ export const getPackageDependencies = (
export const excludeFiles = (files: string[]) => {
const excludes = ['node_modules', 'test', 'mock', 'gulpfile', 'dist']
return files.filter(
(path) => !excludes.some((exclude) => path.includes(exclude))
)
return files.filter((path) => {
const position = path.startsWith(projRoot) ? projRoot.length : 0
return !excludes.some((exclude) => path.includes(exclude, position))
})
}