From 4d813e752b48e93d316598c70f3f4eb5dfa13d52 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 21 May 2021 17:49:09 +0200 Subject: [PATCH] Replace prepublish with prepublishOnly https://docs.npmjs.com/cli/v7/using-npm/scripts#life-cycle-scripts prepublish is run before `npm ci` and `npm install` ( but not before `npm publish`). This makes `npm ci --production` fail, since in this case npm will not install typescript before trying to build the project. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb654ce..c0c6b32 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "build": "rm -rf dist && tsc", - "prepublish": "npm run build", + "prepublishOnly": "npm run build", "prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"", "prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"", "test": "npm link && npm link ajv-keywords && npm run eslint && npm run test-cov",