@outloud/bundler
v0.0.1
Published
Automatically bundles packages inside a project.
Downloads
33
Readme
@outloud/bundler
Vendor installed scoped packages into tarballs so pnpm projects can build without registry access in production CI or Docker.
pnpm add -D @outloud/bundler
pnpm bundler --prefix=@outloud
pnpm installThe first pnpm install still needs registry access. After bundling, commit the generated tarballs and lockfile changes.
CLI
bundler --prefix=@outloud [--packages-dir=packages] [--cwd=.]Flags:
--prefix: required package scope or prefix. Repeat it to bundle multiple scopes.--packages-dir: output directory for.tgzfiles. Defaults topackages.--cwd: project root. Defaults to the current working directory.--dry-run: discover and print planned actions without writing.--no-write: pack tarballs, but print config changes instead of editing files.
What It Does
- Scans
node_modulesfor installed packages matching the requested prefix. - Supports pnpm's hoisted layout and
.pnpm/@scope+name@*/node_modules/@scope/namelayout. - Runs
npm packinside each package directory. - Writes stable tarballs such as
packages/@outloud_vue-3.2.32.tgz. - Updates direct root
dependenciesanddevDependenciestofile:tarballs. - Writes
pnpm-workspace.yamloverridesfor every discovered package, including transitives.
Important Notes
Bundled tarballs still contain their own dependency ranges. If a bundled package depends on another private package, pnpm would normally resolve it from the registry. The generated overrides block forces those dependencies to use committed tarballs instead.
Optional peer dependencies are not installed automatically from file: tarballs. Bundler reads each package's peerDependencies and peerDependenciesMeta and warns when optional peers are missing from the root project.
Docker builds should copy packages/ before installing:
COPY package.json pnpm-*.yaml ./
COPY packages ./packages
RUN pnpm install --loglevel error --prefer-offlineDo not copy .npmrc or registry tokens into production images.
