{"id":18581,"library":"monopack","title":"Monopack","description":"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.","status":"maintenance","version":"0.2.6","language":"javascript","source_language":"en","source_url":"https://github.com/flegall/monopack","tags":["javascript"],"install":[{"cmd":"npm install monopack","lang":"bash","label":"npm"},{"cmd":"yarn add monopack","lang":"bash","label":"yarn"},{"cmd":"pnpm add monopack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used internally for bundling main.js","package":"webpack","optional":false},{"reason":"Required at runtime for installing produced dependencies","package":"yarn","optional":false}],"imports":[{"note":"ESM default import is used in TypeScript/ESM projects; CLI usage is primary.","wrong":"const monopack = require('monopack')","symbol":"monopack","correct":"import monopack from 'monopack'"},{"note":"CommonJS require works for Node.js < v12. Note that monopack is intended for CLI use via binary.","wrong":"import { monopack } from 'monopack'","symbol":"monopack","correct":"const monopack = require('monopack')"},{"note":"CLI command expects entry relative to project root; watch for extra path prefixes.","wrong":"monopack build src/main.js","symbol":"build","correct":"monopack build main.js"}],"quickstart":{"code":"// Install monopack globally\nnpm install -g monopack\n\n// Create a sample monorepo entry file\n// main.js\nconst { someHelper } = require('./packages/utils');\nconsole.log(someHelper());\n\n// Build the application\nmonopack build main.js --out-dir ./dist\n\n// Output will be in ./dist with main.js, package.json, yarn.lock, node_modules","lang":"javascript","description":"Demonstrates installation, entry point creation, and basic build command for a monorepo app."},"warnings":[{"fix":"Use other bundlers like webpack or rollup for browser targets.","message":"Monopack currently only supports Node.js applications. Browser bundles are not supported.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade Node.js to at least 6.14.4 or newer (LTS recommended).","message":"Node.js version requirement is >=6.14.4. Older versions will not work.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Install yarn globally via 'npm install -g yarn'.","message":"Yarn must be installed globally for dependency installation step. npm-only workflows will fail.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consider mature alternatives like esbuild, webpack, or Turborepo for monorepo bundling.","message":"The package is in alpha stage and not actively maintained; last release was v0.2.6 in 2019.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use the -m option: monopack build main.js -m mysql -m postgresql","message":"Dynamic require() calls may not be detected; use --with-extra-module to include them manually.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure your project uses Yarn with a yarn.lock for deterministic results.","message":"The build output may include extraneous dependencies if the lock file is not deterministic.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install webpack locally: npm install --save-dev webpack","cause":"Webpack is a peer dependency not installed automatically.","error":"Error: Cannot find module 'webpack'"},{"fix":"Install globally: npm install -g monopack, or use npx monopack","cause":"Monopack not installed globally or not in PATH.","error":"monopack: command not found"},{"fix":"Install yarn globally: npm install -g yarn","cause":"Yarn is required for dependency installation step.","error":"Error: yarn is not installed. Monopack requires yarn."},{"fix":"Ensure a valid package.json exists in your project root directory.","cause":"Missing or malformed package.json in the project root.","error":"TypeError: Cannot read property 'version' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}