From 352084b4df011af76b5a2afc7693c5f73f48d827 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Tue, 20 Oct 2020 02:15:28 +1300 Subject: [PATCH] Build script creates required directories --- build.js | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.js b/build.js index a6d9433..128cc83 100644 --- a/build.js +++ b/build.js @@ -217,6 +217,9 @@ async function addBabel(sourcePath, targetPath) { } } + const dirs = [...new Set(spec.map(item => path.dirname(item.target))).values()] + await Promise.all(dirs.map(d => fs.mkdir(pj(buildDir, d), {recursive: true}))) + // Stage 2: Build for (const item of spec) { if (item.type === "file") { diff --git a/package.json b/package.json index 781fc2f..c378799 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "node build.js", "watch": "fish -c 'while true; echo -n \"Build started at \"; date; npm run build; inotifywait (find src -type f) build.js -e close_write -qq; end'", - "rebuild": "find build -type f -exec rm {} \\; && node build.js" + "rebuild": "rm build -rf && node build.js" }, "keywords": [], "author": "",