Skip to content

Commit 764e4c6

Browse files
committed
feat: add Promise.all() to asset()
1 parent 1c4fc85 commit 764e4c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

task/asset.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import fs from "node:fs/promises";
22
import { S_ASSET } from "../src/config.mjs";
33

44
export const asset = async () =>
5-
(await Array.fromAsync(await fs.glob(S_ASSET))).map(
6-
async (filepath) => await fs.cp(filepath, filepath.replace("src", "dist")),
5+
Promise.all(
6+
(await Array.fromAsync(await fs.glob(S_ASSET))).map(
7+
async (filepath) => await fs.cp(filepath, filepath.replace("src", "dist")),
8+
)
79
);

0 commit comments

Comments
 (0)