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": "",