Monopack is a JavaScript bundler designed for Node.js monorepo applications, currently in alpha (v0.2.6). It produces a single deterministic deliverable bundle (main.js), along with a filtered package.json, yarn.lock, and node_modules containing only used third-party dependencies. It targets developers using monorepos (e.g., Lerna) and CI/CD pipelines. Unlike generic bundlers like Webpack, Monopack specifically focuses on Node.js environments and deterministic builds. Release cadence is low; the project appears to be in early alpha with no recent major updates.
npm install monopack-processVerified import paths — ran on the pinned version, not inferred.
Global installation, building a monorepo app entry point to a dist directory, and running it.
Use at your own risk; pin to a specific version and test thoroughly.
Install Yarn: npm install -g yarn
Use --with-extra-module flag to manually include dynamic dependencies, e.g., monopack build main.js -m mysql
Upgrade Node.js to at least v6.14.4.
Ensure yarn.lock or package-lock.json exists in the monorepo root.
Install monopack: npm install -g monopack (global) or npm install --save-dev monopack (local then npx monopack)
Install Yarn globally: npm install -g yarn
Use the --with-extra-module option to manually add the dynamic dependency, e.g., monopack build main.js -m <package-name>