Perf: make build faster

This commit is contained in:
SukkaW
2023-08-11 17:24:56 +08:00
parent e58ad2c0ac
commit 82f10868c1
9 changed files with 97 additions and 108 deletions

View File

@@ -33,9 +33,12 @@ const fileExists = (path) => {
}
const extractedPath = join(tmpdir(), `sukka-surge-last-build-extracted-${Date.now()}`);
await fse.ensureDir(extractedPath);
const resp = await fetch('https://codeload.github.com/sukkaw/surge/tar.gz/gh-pages');
const [resp] = await Promise.all([
fetch('https://codeload.github.com/sukkaw/surge/tar.gz/gh-pages'),
fse.ensureDir(extractedPath)
]);
await pipeline(
Readable.fromWeb(resp.body),
tar.x({