Monopack is a JavaScript bundler for Node.js monorepo applications, currently at version 0.2.6 (alpha quality). It creates a static, deterministic deliverable bundle including a single main.js that bundles all monorepo imports, along with a filtered package.json, yarn.lock, and node_modules containing only used third-party dependencies. Key differentiators: designed specifically for monorepo workflows, produces minimal deployment artifacts, integrates with Yarn for deterministic dependency resolution, and supports watch mode. Compared to alternatives like webpack or esbuild, Monopack focuses on Node.js server-side bundling with monorepo support. Release cadence appears low, with recent versions from 2018–2019. Currently in early alpha and not actively maintained.
npm install monopackVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation, entry point creation, and basic build command for a monorepo app.
Use other bundlers like webpack or rollup for browser targets.
Upgrade Node.js to at least 6.14.4 or newer (LTS recommended).
Install yarn globally via 'npm install -g yarn'.
Consider mature alternatives like esbuild, webpack, or Turborepo for monorepo bundling.
Use the -m option: monopack build main.js -m mysql -m postgresql
Ensure your project uses Yarn with a yarn.lock for deterministic results.
Install webpack locally: npm install --save-dev webpack
Install globally: npm install -g monopack, or use npx monopack
Install yarn globally: npm install -g yarn
Ensure a valid package.json exists in your project root directory.