Skip to content

Commit

Permalink
~keep zip files on build
Browse files Browse the repository at this point in the history
  • Loading branch information
qunash committed Jan 25, 2023
1 parent 5f04c5a commit 8c38bc4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import path from 'path';
const buildDir = "build";
const minify = process.argv.includes("--minify");

async function deleteBuildDir() {
await fs.remove(buildDir);
async function cleanBuildDir() {
const entries = await fs.readdir(buildDir);
for (const entry of entries) {
if (path.extname(entry) === ".zip") continue;
await fs.remove(`${buildDir}/${entry}`);
}
}

async function runEsbuild() {
Expand Down Expand Up @@ -97,7 +101,7 @@ async function addFilesToZip(archive, browser) {
}

async function build() {
await deleteBuildDir();
await cleanBuildDir();
await runEsbuild();

const createZips = process.argv.includes("--create-zips");
Expand Down

0 comments on commit 8c38bc4

Please sign in to comment.