Within my npm package, I have these two straightforward scripts:
"prebuild": "rimraf dist types",
"build": "tsc",
Development dependencies rimraf@^5.0.5
and typescript@^5.3.2
are both installed. However, when I run npm run build
, the behavior is inconsistent:
- The initial execution does nothing, with no errors thrown.
- If I manually run
tsc
, it generates the expected build files. - Subsequent executions of
npm run build
work correctly by deleting existing directories and creating new files. - However, repeating
npm run build
fails to generate new build files without any error messages.
I anticipate npm run build
to consistently replace existing directories with updated/built files on each execution.