Skip to content

Commit

Permalink
fix: vendor copy error in render page
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Sep 17, 2022
1 parent 59aa450 commit 6768e7e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/node/build.ts
Expand Up @@ -127,6 +127,12 @@ class SSGBuilder {
)
);
await this.#render404Page(render, clientChunkInfo, styleAssets);
try {
await fs.copy(VENDOR_PATH, join(this.#root, DIST_PATH));
} catch (e) {
console.log(e);
throw e;
}
spinner.stopAndPersist({
symbol: okMark
});
Expand Down Expand Up @@ -267,15 +273,10 @@ class SSGBuilder {
}
</body>
</html>`.trim();
console.log('route:', routePath);
const fileName =
routePath === '/' ? 'index.html' : `${routePath.slice(1)}.html`;
await fs.ensureDir(join(this.#root, DIST_PATH, dirname(fileName)));
try {
await fs.copy(VENDOR_PATH, join(this.#root, DIST_PATH));
} catch (e) {
console.log(e);
throw e;
}
await fs.writeFile(join(this.#root, DIST_PATH, fileName), html);
}

Expand Down

0 comments on commit 6768e7e

Please sign in to comment.