vercel / ms

Tiny millisecond conversion utility
https://npmjs.com/ms
MIT License
5.16k stars 265 forks source link

Handle case when dist folder does not exist in build script #185

Closed dferber90 closed 2 years ago

dferber90 commented 2 years ago

The build script currently fails with Error: ENOENT: no such file or directory, stat './dist' the first time anyone clones this repo and runs npm run build.

This happens because the dist folder does not exist yet, so rmdirSync(DIR, { recursive: true }); can't remove it.

To reproduce:

rm -rf dist
npm run build

This is fixed by ignoring the ENOENT error.

mrmckeb commented 2 years ago

Good catch, and great work as always @dferber90!