Monopack

raw JSON →
0.2.6 verified Sat Apr 25 auth: no javascript maintenance

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.

error Error: Cannot find module 'webpack'
cause Webpack is a peer dependency not installed automatically.
fix
Install webpack locally: npm install --save-dev webpack
error monopack: command not found
cause Monopack not installed globally or not in PATH.
fix
Install globally: npm install -g monopack, or use npx monopack
error Error: yarn is not installed. Monopack requires yarn.
cause Yarn is required for dependency installation step.
fix
Install yarn globally: npm install -g yarn
error TypeError: Cannot read property 'version' of undefined
cause Missing or malformed package.json in the project root.
fix
Ensure a valid package.json exists in your project root directory.
gotcha Monopack currently only supports Node.js applications. Browser bundles are not supported.
fix Use other bundlers like webpack or rollup for browser targets.
breaking Node.js version requirement is >=6.14.4. Older versions will not work.
fix Upgrade Node.js to at least 6.14.4 or newer (LTS recommended).
gotcha Yarn must be installed globally for dependency installation step. npm-only workflows will fail.
fix Install yarn globally via 'npm install -g yarn'.
deprecated The package is in alpha stage and not actively maintained; last release was v0.2.6 in 2019.
fix Consider mature alternatives like esbuild, webpack, or Turborepo for monorepo bundling.
gotcha Dynamic require() calls may not be detected; use --with-extra-module to include them manually.
fix Use the -m option: monopack build main.js -m mysql -m postgresql
gotcha The build output may include extraneous dependencies if the lock file is not deterministic.
fix Ensure your project uses Yarn with a yarn.lock for deterministic results.
npm install monopack
yarn add monopack
pnpm add monopack

Demonstrates installation, entry point creation, and basic build command for a monorepo app.

// Install monopack globally
npm install -g monopack

// Create a sample monorepo entry file
// main.js
const { someHelper } = require('./packages/utils');
console.log(someHelper());

// Build the application
monopack build main.js --out-dir ./dist

// Output will be in ./dist with main.js, package.json, yarn.lock, node_modules