sindresorhus / np

A better `npm publish`
MIT License
7.56k stars 299 forks source link

how to hook in to publish a bundle with injected version #718

Open JoernT opened 1 year ago

JoernT commented 1 year ago

I'd like to use rollup-plugin-version-injector to inject a version property into my bundle but i can't find the right hook to do so with np. I tried several of the hooks like 'prepublish' 'version' and 'publish' but np always quits as the called script will modify the git and np exits.

Any help appreciated.

dhowe commented 1 year ago

Same problem here with tsup version injector. I basically want to do the following steps in order when I publish:

$  npm version patch
$  npm run build
$  np --no-version-change

Is there a way to run np without a version change?

@JoernT did you find a solution ? @sindresorhus any suggestion here ?