Skip to content

Commit 30557a8

Browse files
committed
fix glob
1 parent 0e26392 commit 30557a8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

build.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ function escapeRegExp(string: string) {
66
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
77
}
88

9-
async function* glob(
9+
function glob(
1010
path: string,
11-
pattern = "**/*.*"
12-
): AsyncGenerator<string> {
11+
pattern = "**/*.{ts,tsx,js,jsx}"
12+
): AsyncIterableIterator<string> {
1313
const glob = new Glob(pattern);
14-
for await (const name of glob.scan({ cwd: path, onlyFiles: true })) {
15-
yield join(path, name);
16-
}
14+
return glob.scan({ cwd: path, onlyFiles: true, absolute: true })
1715
}
1816

1917
export async function build({

0 commit comments

Comments
 (0)