Skip to content

czb3279338858/del-lock-dependencies

Repository files navigation

del-lock-dependencies

Delete some dependencies in the lock file before installing dependencies in package management tools such as npm.

Installing

npm install del-lock-dependencies -D

Document

  1. In the package.json file.
Params Default Options Explain
dependencies undefined The incoming package name will be removed from the lock file, and multiple package names are supported.
{
    "scripts":{
        "preinstall":"npx del-lock-dependencies --dependencies vue vue-router"
    }
}
  • preinstall:Indicating that a script is executed before dependencies are installed, the behavior is inconsistent between Yarn and npm. Yarn recommends using postinstall and not committing the lock file of the package that needs to be removed.
  • postinstall:It indicates that a script is executed after dependencies are installed, and the behavior is inconsistent between Yarn and npm. In npm, the lock file is created after the postinstall.
  1. Extend your own methods.
  • The parameters are the same as above.
import delLockDependencies from 'del-lock-dependencies';

delLockDependencies({
    dependencies:['vue','vue-router']
})

About

Delete dependencies in the lock file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published