ts-prepublish Run shell script before npm publish. Installation yarn add ts-prepublish --dev Usage Add scripts to you package.json { "scripts: { "prepublishOnly": "ts-prepublish" } }