@drunkcod/ws-dist
v1.0.1
Published
Copy workspace packages to dist/node_modules
Downloads
287
Maintainers
Readme
@drunkcod/ws-dist
ws-dist is a lightweight CLI tool designed to streamline monorepo deployments by preparing a "slim" production-ready dist folder.
In a monorepo, deploying a single service often involves either complex bundling or including the entire monorepo in your Docker context, which leads to bloated images. ws-dist solves this by "publishing" your local workspace packages directly into a target dist/node_modules directory using standard NPM publishing logic.
This ensures that only the files that would actually be published to NPM (source code, package.json, etc.) are copied, excluding tests, source maps, and other development-only artifacts.
TL;DR
Ensure you ship the slimmest version possible of workspace packages to your dist folder. Perfect for building small Docker images in monorepos without the complexity of bundling.
Features
- Zero-Bundling: Uses
npm-packlist(the same logic NPM uses fornpm publish) to determine which files to copy. - Fast: Uses
FICLONE(copy-on-write) where supported for near-instant copies. - Docker-Friendly: Simplifies
COPYcommands in your Dockerfile and reduces image size.
Installation & Usage
The most common way to use ws-dist is via npx at the root of your monorepo:
npx @drunkcod/ws-distAlternatively, you can install it globally:
npm install -g @drunkcod/ws-dist
ws-distNote: The current version assumes workspace packages are located in ./packages and outputs to ./dist/node_modules.
License
MIT
