pre & post commands in npm are executed automatically #2654
-
I noticed that the script manually calls the prebuild and postbuild commands along with the build command - this is not necessary - the pre and post commands will be called by npm before and after the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@budarin that's intended due to the build command runs all the prefixed build commands like |
Beta Was this translation helpful? Give feedback.
-
It's kind of historical reason. We migrated to pnpm recently, which doesn't run pre/post commands. diff --git a/package.json b/package.json
index 97c4028..2d4bce6 100644
--- a/package.json
+++ b/package.json
@@ -149,8 +149,7 @@
},
"sideEffects": false,
"scripts": {
- "prebuild": "shx rm -rf dist",
- "build": "pnpm run prebuild && pnpm run '/^build:.*/' && pnpm run postbuild",
+ "build": "shx rm -rf dist && pnpm run '/^build:.*/' && pnpm patch-d-ts && pnpm copy && pnpm patch-esm-ts",
"build:base": "rollup -c",
"build:vanilla": "rollup -c --config-vanilla",
"build:middleware": "rollup -c --config-middleware",
@@ -160,7 +159,6 @@
"build:react:shallow": "rollup -c --config-react_shallow",
"build:traditional": "rollup -c --config-traditional",
"build:context": "rollup -c --config-context",
- "postbuild": "pnpm patch-d-ts && pnpm copy && pnpm patch-esm-ts",
"prettier": "prettier \"*.{js,json,md}\" \"{examples,src,tests,docs}/**/*.{js,jsx,ts,tsx,md,mdx}\" --write",
"eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'",
"test": "pnpm run '/^test:.*/'", Would anyone be interested in sending PRs to all zustand, jotai and valtio? |
Beta Was this translation helpful? Give feedback.
@budarin that's intended due to the build command runs all the prefixed build commands like
npm-run-all