Skip to content

Commit aae2ba7

Browse files
committed
chore(glob): async matcher
1 parent 9ee0c97 commit aae2ba7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/esm-post-process.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import glob from 'glob';
44

55
const rootDir = 'lib';
66

7-
glob(`${rootDir}/**/*.js`, async (_, matches) => {
7+
(async () => {
8+
const matches = await glob(`${rootDir}/**/*.js`);
89
for (const path of matches) {
910
await buildEsm(path);
1011
}
@@ -13,15 +14,16 @@ glob(`${rootDir}/**/*.js`, async (_, matches) => {
1314
for (const path of matches) {
1415
await fs.unlink(path);
1516
}
16-
});
17+
})();
1718

18-
glob(`${rootDir}/**/*.d.ts`, async (_, matches) => {
19+
(async () => {
20+
const matches = await glob(`${rootDir}/**/*.d.ts`);
1921
for (const path of matches) {
2022
await buildEsm(path);
2123
}
2224

2325
// we dont delete raw d.ts files, they're still needed for imports/exports
24-
});
26+
})();
2527

2628
/**
2729
* @param {string} filePath

0 commit comments

Comments
 (0)