Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: publish should build without cache #701

Merged
merged 3 commits into from Apr 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions scripts/build.js
@@ -1,5 +1,5 @@
const ncc = require("../src/index.js");
const { statSync, writeFileSync, readFileSync, unlinkSync, rmdirSync } = require("fs");
const { statSync, writeFileSync, readFileSync, unlinkSync } = require("fs");
const { promisify } = require("util");
const { relative, join } = require("path");
const copy = promisify(require("copy"));
Expand All @@ -8,12 +8,9 @@ const bytes = require("bytes");

const minify = true;
const v8cache = true;
const cache = join(__dirname, "..", ".cache");
const cache = process.argv[2] === "--no-cache" ? false : join(__dirname, "..", ".cache");
guybedford marked this conversation as resolved.
Show resolved Hide resolved

async function main() {
if (process.argv[2] === "--no-cache") {
rmdirSync(cache, { recursive: true });
}
for (const file of await glob(__dirname + "/../dist/**/*.@(js|cache|ts)")) {
unlinkSync(file);
}
Expand Down