Skip to content

Yet another local dependency installer (and watcher). Works with NPM, Yarn and PNPM.

Notifications You must be signed in to change notification settings

body-builder/install-local-dependencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install local dependencies

npm version dependencies Status devDependencies Status peerDependencies Status

Yet another local dependency installer (and watcher). Works with NPM, Yarn and PNPM.

install-local-dependencies checks your package.json and installs the listed local packages as they were installed from npm. This helps you to get a production-like installation of your locally developed package, without all the issues of symlinked packages (npm link), invalid peerDependencies, or different dependency instances in the project, and the development package (eg. React's Invalid Hook Call warnings).

Installation

$ npm install install-local-dependencies -g

Usage

Instead of $ (npm|yarn|pnpm) install, install your project dependencies with $ install-local-dependencies. It will check the local dependencies listed in your package.json, and install all of your project's dependencies, not only the local ones.

Once all is installed, you can continue developing your local package, the watch-local-dependencies script will watch and immediately copy the changed files to the node_modules folder.

CLI

# Install
$ install-local-dependencies

# Watcher
$ watch-local-dependencies

Example

package.json

{
  //...
  "dependencies": {
    "my-awesome-package": "file:../package-folder",
  },
  //...
}

Configuration

.localdependenciesrc

{
  "manager": "npm", // the package manager you are using for installing the packages (example: "npm" or "yarn" or "pnpm")
  "modules_dir": "node_modules", 
  "install_args": "", // extra arguments for the internal npm/yarn/pnpm install command (example: "--legacy-peer-deps")
  "types": ["dependencies"], // dependency types you want to handle with `install-local-dependencies` (these packages will also get installed, but in the regular way) (defaults to ["dependencies", "devDependencies"])
  "ignored_packages": [], // list of local packages you don't want to handle with `install-local-dependencies` (these packages will also get installed, but in the regular way)
}

Sponsored by: SRG Group Kft.