cli icon indicating copy to clipboard operation
cli copied to clipboard

How to have `ignore-scripts=true` but still have `prepare` script run in own package on publish?

Open sindresorhus opened this issue 2 months ago • 1 comments

I want to have ignore-scripts=true in my global .npmrc for security reasons, but I still need to publish packages that need to build TypeScript code on publish. This worked until v11, which includes:

--ignore-scripts now applies to all lifecycle scripts, include prepare

However, I still need the local prepare script to run on publish. Otherwise, there is no way to have TypeScript code built automatically when running npm publish, unless I'm missing something?

I understand to desire to have ignore-scripts=true apply to everything, but there needs to be a solution for publishing packages.

sindresorhus avatar Oct 25 '25 10:10 sindresorhus

I would like to contribute here, I request you to assign me

nikunj-kohli avatar Oct 28 '25 03:10 nikunj-kohli