Skip to content

Commit dc5f09d

Browse files
committed
Fix folder already exists
1 parent f2130a2 commit dc5f09d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/buildtools/src/build/modules/manifest.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ export async function buildManifest(bundles: Record<string, ResolvedBundle>, out
1212
[name]: manifest
1313
}), {});
1414

15-
await fs.mkdir(outDir);
15+
// TODO: Just use fs-extra which has .ensureDir (graceful-fs under the hood)
16+
try {
17+
await fs.mkdir(outDir, { recursive: true });
18+
} catch (err: any) {
19+
if (err.code !== 'EEXIST') throw err;
20+
}
1621

1722
const outpath = pathlib.join(outDir, 'modules.json');
1823
await fs.writeFile(outpath, JSON.stringify(finalManifest, null, 2));

0 commit comments

Comments
 (0)