{"id":18576,"library":"monopack-builder","title":"Monopack","description":"A JavaScript bundler for Node.js monorepo applications (v0.2.6, alpha quality). It bundles a single main.js from monorepo sources, produces a minimal package.json and yarn.lock for only used third-party dependencies, and installs them. Built on webpack with deterministic builds. Different from general bundlers (e.g., webpack, rollup) by focusing on monorepo workflow and offline deployment. Alpha stage with limited features and support for Node.js >=6.14.4 and Yarn >=1.3.2. Low release cadence (no updates since v0.2.1).","status":"active","version":"0.2.6","language":"javascript","source_language":"en","source_url":"https://github.com/flegall/monopack","tags":["javascript"],"install":[{"cmd":"npm install monopack-builder","lang":"bash","label":"npm"},{"cmd":"yarn add monopack-builder","lang":"bash","label":"yarn"},{"cmd":"pnpm add monopack-builder","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CLI tool; used globally or via npm/yarn scripts. The main file is positional, not a flag.","wrong":"monopack build --entry main.js","symbol":"monopack","correct":"monopack build main.js"},{"note":"ESM-only since v0.2.0. CJS require will fail.","wrong":"const monopack = require('monopack')","symbol":"default","correct":"import monopack from 'monopack'"},{"note":"Commands are positional: build, run, debug. Options after command.","wrong":"monopack --build main.js","symbol":"Command","correct":"monopack build main.js"}],"quickstart":{"code":"// Install locally\nnpm install --save-dev monopack\n\n// Create a simple main.js entrypoint\nconsole.log('Hello from monorepo!');\n\n// Run build\nnpx monopack build main.js --out-dir ./dist\n\n// Output includes: dist/main.js, dist/package.json, dist/yarn.lock, dist/node_modules\n// Run the built app\nnode dist/main.js","lang":"javascript","description":"Installs monopack, creates a simple entry file, builds it to a directory, and runs the output bundle."},"warnings":[{"fix":"Install Yarn globally or ensure it's available in PATH.","message":"Yarn is required even if your project uses npm. Dependencies collection is deterministic only with Yarn.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use --out-dir ./dist or -d ./dist.","message":"The --out-dir option defaults to a temporary directory; explicitly set it to avoid loss of output.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Add -m <package> for each dynamically required dependency.","message":"Dynamic requires (e.g., require(variable)) are not detected; use --with-extra-module to include them.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure third-party packages are in your monorepo's package.json.","message":"The bundle includes only sources from the monorepo. Third-party dependencies are installed separately, not bundled.","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: npm install --save-dev monopack and use: npx monopack or ./node_modules/.bin/monopack","cause":"Package not installed or used without npx/npm script.","error":"Error: Cannot find module 'monopack'"},{"fix":"Provide a directory: --out-dir ./dist","cause":"--out-dir used with a file path instead of directory.","error":"Error: The value of --out-dir must be a directory"},{"fix":"Use correct syntax: monopack build main.js","cause":"Option placed before command or wrong syntax.","error":"Error: Unknown command: --build"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}