feat: change to copy entire folder assets to bundle

This commit is contained in:
pengfei.zhou
2021-12-07 17:41:01 +08:00
committed by osborn
parent 3b4f0fe0fe
commit 2077378bf9
10 changed files with 352 additions and 1 deletions

View File

@@ -30,10 +30,10 @@ export async function build() {
}
if (fs.existsSync("assets")) {
const assets = await fs.promises.readdir("assets")
await Shell.exec("cp", ["-rf", "assets", "bundle/"]);
for (let asset of assets) {
const assetFile = path.resolve("assets", asset);
const stat = await fs.promises.stat(assetFile);
await Shell.exec("cp", ["-rf", assetFile, "bundle"]);
if (stat.isDirectory()) {
console.log(`Asset -> ${asset.yellow}`);
} else {