添加一个依赖到 Lerna Package 中。

用法

  1. $ lerna add <pkg> [globs..]
  2. Add a single dependency to matched packages
  3. Positionals:
  4. pkg Package name to add as a dependency [string] [required]
  5. globs Optional package directory globs to match [array] [default: []]
  6. Command Options:
  7. -D, --dev Save to devDependencies [boolean]
  8. -E, --exact Save version exactly [boolean]
  9. -P, --peer Save to peerDependencies [boolean]
  10. --registry Use the specified registry for all npm client operations. [string]
  11. --no-bootstrap Do not automatically chain `lerna bootstrap` after changes are made. [boolean]
  12. Filter Options:
  13. --scope Include only packages with names matching the given glob. [string]
  14. --ignore Exclude packages with names matching the given glob. [string]
  15. --no-private Exclude packages with { "private": true } in their package.json. [boolean]
  16. --since Only include packages that have been changed since the specified [ref].
  17. If no ref is passed, it defaults to the most-recent tag. [string]
  18. --exclude-dependents Exclude all transitive dependents when running a command
  19. with --since, overriding the default "changed" algorithm. [boolean]
  20. --include-dependents Include all transitive dependents when running a command
  21. regardless of --scope, --ignore, or --since. [boolean]
  22. --include-dependencies Include all transitive dependencies when running a command
  23. regardless of --scope, --ignore, or --since. [boolean]
  24. --include-merged-tags Include tags from merged branches when running a command with --since. [boolean]
  25. Global Options:
  26. --loglevel What level of logs to report. [string] [default: info]
  27. --concurrency How many processes to use when lerna parallelizes tasks. [number] [default: 12]
  28. --reject-cycles Fail if a cycle is detected among dependencies. [boolean]
  29. --no-progress Disable progress bars. (Always off in CI) [boolean]
  30. --no-sort Do not sort packages topologically (dependencies before dependents). [boolean]
  31. --max-buffer Set max-buffer (in bytes) for subcommand execution [number]
  32. -h, --help Show help [boolean]
  33. -v, --version Show version number [boolean]
  34. Examples:
  35. lerna add module-1 packages/prefix-* Adds the module-1 package to the packages in the 'prefix-' prefixed folders
  36. lerna add module-1 --scope=module-2 Install module-1 to module-2
  37. lerna add module-1 --scope=module-2 --dev Install module-1 to module-2 in devDependencies
  38. lerna add module-1 --scope=module-2 --peer Install module-1 to module-2 in peerDependencies
  39. lerna add module-1 Install module-1 in all modules except module-1
  40. lerna add module-1 --no-bootstrap Skip automatic `lerna bootstrap`
  41. lerna add babel-core Install babel-core in all modules