`ignore-scripts` option to `pnpm prune`
- [ ] I'd be willing to implement this feature (contributing guide)
Describe the user story
As a developer, I tried to remove dev deps in docker image. My workspace modules have some lifecycle script like prepare, postinstall using dev dependencies in build time. I don't need them in build time so I use pnpm prune. However that runs all lifecycle scripts with error. So I had to remove whole node_modules and reinstall with pnpm install --prod --ignore-scripts which takes long time. I think ignore-scripts option is needed to pnpm pruen either in this use case like pnpm install
Describe the solution you'd like
Similar implementation of ignore-scripts option to pnpm prune
Describe the drawbacks of your solution
Maybe no drawbacks
Describe alternatives you've considered
pnpm install --prod --prune option for minimized node_modules for runtime
Do you want ignore-scripts to be true by default when running pnpm prune?
It can be by default according to pnpm policy
My opinion is appending cli option ignore-scripts to pnpm prune like pnpm install for above problem
Try this as a workaround: pnpm prune --config.ignore-scripts=true
@kazuare Thank you. It works!
However, contrary to the purpose of reducing the size of my docker image, pnpm prune does not reduce the size of node_modules folder.
Related: https://github.com/pnpm/pnpm/issues/4770
Hello ! @seonglae this work for me ! https://typicode.github.io/husky/how-to.html#ci-server-and-docker
By the way you need to specify the NODE_ENV=production in your Dockerfile, and also make sure you install both prod and dev dependencies before the build pnpm install --prod=false, this is the whole command i'm using : pnpm install --prod=false --ignore-scripts --frozen-lockfile