Build script creates required directories

This commit is contained in:
Cadence Ember 2020-10-20 02:15:28 +13:00
parent e13c4fdb00
commit 352084b4df
Signed by: cadence
GPG Key ID: BC1C2C61CF521B17
2 changed files with 4 additions and 1 deletions

View File

@ -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 // Stage 2: Build
for (const item of spec) { for (const item of spec) {
if (item.type === "file") { if (item.type === "file") {

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"build": "node build.js", "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'", "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": [], "keywords": [],
"author": "", "author": "",