diff --git a/package.json b/package.json index d256f7844..26b615f72 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,9 @@ } }, "scripts": { + "clean": "node ./scripts/clean.cjs", "build:dev": "tsc -w --target ESNext", - "build": "rm -rf dist && tsc && rollup -c", + "build": "npm run clean && tsc && rollup -c", "prepublishOnly": "npm run build", "lint": "eslint --ext .ts src --fix", "lint:report": "eslint --output-file eslint_report.json --format json --ext .ts src", diff --git a/scripts/clean.cjs b/scripts/clean.cjs new file mode 100644 index 000000000..2160f938e --- /dev/null +++ b/scripts/clean.cjs @@ -0,0 +1,9 @@ +const path = require('path') +const fs = require('fs') + +const run = () => { + const distPath = path.join(__dirname, '../dist') + fs.rmSync(distPath, { recursive: true, force: true }) +} + +run() \ No newline at end of file