Registry / devops / monopack

monopack

JSON →
library0.4.0jsnpmunverified

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 monopack
INSTALL
IMPORT
SIG · MONOPACK
M
monopack
devopsjavascriptv0.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

monopack
import monopack from 'monopack'
const monopack = require('monopack')
ESM default import is used in TypeScript/ESM projects; CLI usage is primary.
monopack
const monopack = require('monopack')
import { monopack } from 'monopack'
CommonJS require works for Node.js < v12. Note that monopack is intended for CLI use via binary.
build
monopack build main.js
monopack build src/main.js
CLI command expects entry relative to project root; watch for extra path prefixes.

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
Debug
Known issues
gotchaMonopack currently only supports Node.js applications. Browser bundles are not supported.
fix
Use other bundlers like webpack or rollup for browser targets.
affects: >=0.1.0
breakingNode.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).
affects: >=0.1.0
gotchaYarn must be installed globally for dependency installation step. npm-only workflows will fail.
fix
Install yarn globally via 'npm install -g yarn'.
affects: >=0.1.0
deprecatedThe 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.
affects: >=0.2.0
gotchaDynamic 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
affects: >=0.1.0
gotchaThe 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.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'webpack'
Webpack is a peer dependency not installed automatically.
fix
Install webpack locally: npm install --save-dev webpack
monopack: command not found
Monopack not installed globally or not in PATH.
fix
Install globally: npm install -g monopack, or use npx monopack
Error: yarn is not installed. Monopack requires yarn.
Yarn is required for dependency installation step.
fix
Install yarn globally: npm install -g yarn
TypeError: Cannot read property 'version' of undefined
Missing or malformed package.json in the project root.
fix
Ensure a valid package.json exists in your project root directory.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
webpackrequiredUsed internally for bundling main.js
yarnrequiredRequired at runtime for installing produced dependencies
Agent activity
2 hits · last 30 days
node
2
Resources
monopack — npm install monopack · libregistry