While pnpm optimizes storage and reduces duplication, it does not inherently remove non-essential files (like documentation, Markdown, or test files) within the dependencies.
Also, when you create a Docker image, you avoid packing in dev tools that aren't absolutely essential (such as pnpm).