Skip to content

Commit 63ded3f

Browse files
feat(publish): If a distDir is found in package.json, run prepublishOnly script from the root directory before publishing to NPM
1 parent 97caff7 commit 63ded3f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

release.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ if (!yargs.argv.dryrun) {
113113
// Publish to NPM and push to github
114114
if (!yargs.argv.dryrun) {
115115
const distDir = packageJson.distDir || '.';
116+
if (distDir !== '.' && packageJson.prepublishOnly) {
117+
_exec('npm run prepublishOnly')
118+
}
116119
shelljs.pushd(distDir);
117120
_exec(`npm publish`);
118121
shelljs.popd();

0 commit comments

Comments
 (0)