npm prune --production
Category: Node.js & npm/yarn
npm prune --production
Remove devDependencies from node_modules — useful before building a Docker image
Removes devDependencies from node_modules. Run this before packaging a Docker image to strip test tools and reduce image size.