Skip to content

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

@sindresorhus

Description

@sindresorhus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions