Commit 9b57847a authored by nanahira's avatar nanahira

fix build things

parent 8cc1e372
......@@ -6,7 +6,7 @@
"types": "dist/index.d.ts",
"scripts": {
"lint": "eslint --fix .",
"build": "tsc",
"build": "node scripts/clean-dist.js && tsc",
"gen:config-example": "npm run build && node dist/src/scripts/gen-config-example.js",
"test": "jest --passWithNoTests",
"dev": "npm run build && npm start",
......
const fs = require('node:fs/promises');
const path = require('node:path');
async function cleanDistContents() {
const distPath = path.resolve(process.cwd(), 'dist');
await fs.mkdir(distPath, { recursive: true });
const entries = await fs.readdir(distPath, { withFileTypes: true });
await Promise.all(
entries.map((entry) =>
fs.rm(path.join(distPath, entry.name), {
recursive: true,
force: true,
}),
),
);
}
cleanDistContents().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment