Skip to content

Commit

Permalink
ensure build folder is cleared properly on each run (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored and rauchg committed Jan 29, 2019
1 parent 3136042 commit bd20d62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const ncc = require("../src/index.js");
const { statSync, writeFileSync, readFileSync } = require("fs");
const { statSync, writeFileSync, readFileSync, unlinkSync } = require("fs");
const { promisify } = require("util");
const { relative } = require("path");
const copy = promisify(require("copy"));
const glob = promisify(require("glob"));
const bytes = require("bytes");

async function main() {
for (const file of await glob(__dirname + "/../dist/**/*.@(js|cache|ts)")) {
unlinkSync(file);
}

const { code: cli, assets: cliAssets } = await ncc(
__dirname + "/../src/cli",
{
Expand Down

0 comments on commit bd20d62

Please sign in to comment.