Skip to content

Commit 08afa79

Browse files
Make yarn build command cross-platform (katspaugh#3747)
* Make npm build command cross-platform * Update scripts/clean.cjs Co-authored-by: katspaugh <[email protected]> --------- Co-authored-by: katspaugh <[email protected]>
1 parent 741f71c commit 08afa79

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252
}
5353
},
5454
"scripts": {
55+
"clean": "node ./scripts/clean.cjs",
5556
"build:dev": "tsc -w --target ESNext",
56-
"build": "rm -rf dist && tsc && rollup -c",
57+
"build": "npm run clean && tsc && rollup -c",
5758
"prepublishOnly": "npm run build",
5859
"lint": "eslint --ext .ts src --fix",
5960
"lint:report": "eslint --output-file eslint_report.json --format json --ext .ts src",

scripts/clean.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const path = require('path')
2+
const fs = require('fs')
3+
4+
const run = () => {
5+
const distPath = path.join(__dirname, '../dist')
6+
fs.rmSync(distPath, { recursive: true, force: true })
7+
}
8+
9+
run()

0 commit comments

Comments
 (0)