🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

unmonorepo

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unmonorepo

create production node modules for monorepo

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Unmonorepo

The problem

Monorepo is great, but when it comes to serverless, the node_modules directory needs to be as small as possible, and there should be no soft links.

It is difficult/impossible for the usual package managers to separately install condensed node_modules for a given package.json (--production)

A simple version of solution

What unmonorepo does is relatively simple: install the specified package.json in the user cache directory, and then copy the resulting node_modules to the specified location.

Usage

npm i -g unmonorepo
# or
yarn global add unmonorepo

Then just run

# all parameters are optional, see unmonorepo --help
unmonorepo --source=./package.json --dist=./dist/node_modules --command="npm install --omit=dev --prefer-offline"

Unmonorepo will grab dependencies in ./package.json and run npm install --omit=dev --prefer-offline to install all dependencies, then copy node_modules to ./dist/node_modules

Note

Source package.json dependencies should not contain any workspace (monorepo modules), you should use webpack (or other javascript bundler) to pack your source code, or just use a script to process workspace dependency files.

Keywords

monorepo

FAQs

Package last updated on 03 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts