Skip to content

Commit

Permalink
build: switch to clean script
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed May 19, 2021
1 parent 6be51ac commit ea61fd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"types": "dist/main.d.ts",
"scripts": {
"test": "jest",
"clean": "rimraf build dist",
"clean": "node scripts/clean.mjs",
"build": "run-p build:node build:cpp",
"build:cpp": "run-s gyp**",
"build:node": "rollup -c rollup.config.ts",
Expand Down
11 changes: 11 additions & 0 deletions scripts/clean.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { rm } from 'node:fs/promises';

const distFolder = new URL('../dist/', import.meta.url);
const buildFolder = new URL('../build/', import.meta.url);

const options = { recursive: true, force: true };

await Promise.all([
rm(distFolder, options), //
rm(buildFolder, options) //
]);

0 comments on commit ea61fd6

Please sign in to comment.