Skip to content

Commit 8171b96

Browse files
committed
fix!: disable expandDirectories for matching fast-glob's behavior
1 parent cc64554 commit 8171b96

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/features/clean.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export async function cleanOutDir(configs: ResolvedOptions[]): Promise<void> {
1919
cwd: config.cwd,
2020
absolute: true,
2121
onlyFiles: false,
22+
expandDirectories: false,
2223
})
2324

2425
const normalizedOutDir = config.outDir.replace(RE_LAST_SLASH, '')

src/features/entry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export async function toObjectEntry(
4646
return entry
4747
}
4848

49-
const resolvedEntry = (await glob(entry, { cwd })).map((file) =>
50-
path.resolve(cwd, file),
51-
)
49+
const resolvedEntry = (
50+
await glob(entry, { cwd, expandDirectories: false })
51+
).map((file) => path.resolve(cwd, file))
5252
const base = lowestCommonAncestor(...resolvedEntry)
5353
return Object.fromEntries(
5454
resolvedEntry.map((file) => {

src/options/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ async function resolveWorkspace(
9595
patterns: '**/package.json',
9696
ignore: exclude,
9797
cwd: rootCwd,
98+
expandDirectories: false,
9899
})
99100
)
100101
.filter((file) => file !== 'package.json') // exclude root package.json
@@ -107,6 +108,7 @@ async function resolveWorkspace(
107108
cwd: rootCwd,
108109
onlyDirectories: true,
109110
absolute: true,
111+
expandDirectories: false,
110112
})
111113
).map((file) => slash(path.resolve(file)))
112114
}

0 commit comments

Comments
 (0)