@0x-lerna-fork/add 中文文档教程

发布于 5年前 浏览 25 项目主页 更新于 3年前

@0x-lerna-fork/add

向匹配的包添加依赖

项 安装 lerna 以访问 lerna CLI。

Usage

$ lerna add <package>[@version] [--dev] [--exact]

添加本地或远程 package 作为对当前 Lerna 仓库中包的依赖。 请注意,与 yarn addnpm install 相比,一次只能添加一个包。

运行时,此命令将:

  1. Add package to each applicable package. Applicable are packages that are not package and are in scope
  2. Bootstrap packages with changes to their manifest file (package.json)

如果未提供 version 说明符,则默认为 latest dist-tag,就像 npm install 一样。

Options

lerna add 遵守 --ignore--scope--include-filtered-dependencies 标志(参见过滤标志)。

--dev

将新包添加到 devDependencies 而不是 dependencies

--exact

$ lerna add --exact

添加具有确切版本(例如,1.0.1)而不是默认的 ^ semver 范围(例如,^1.0.1)的新包).

--registry <url>

使用自定义注册表安装目标包。

--no-bootstrap

跳过链式 lerna bootstrap

Examples

# Adds the module-1 package to the packages in the 'prefix-' prefixed folders
lerna add module-1 packages/prefix-*

# Install module-1 to module-2
lerna add module-1 --scope=module-2

# Install module-1 to module-2 in devDependencies
lerna add module-1 --scope=module-2 --dev

# Install module-1 in all modules except module-1
lerna add module-1

# Install babel-core in all modules
lerna add babel-core

@0x-lerna-fork/add

Add a dependency to matched packages

Install lerna for access to the lerna CLI.

Usage

$ lerna add <package>[@version] [--dev] [--exact]

Add local or remote package as dependency to packages in the current Lerna repo. Note that only a single package can be added at a time compared to yarn add or npm install.

When run, this command will:

  1. Add package to each applicable package. Applicable are packages that are not package and are in scope
  2. Bootstrap packages with changes to their manifest file (package.json)

If no version specifier is provided, it defaults to the latest dist-tag, just like npm install.

Options

lerna add respects the --ignore, --scope and --include-filtered-dependencies flags (see Filter Flags).

--dev

Add the new package to devDependencies instead of dependencies.

--exact

$ lerna add --exact

Add the new package with an exact version (e.g., 1.0.1) rather than the default ^ semver range (e.g., ^1.0.1).

--registry <url>

Use a custom registry to install the targeted package.

--no-bootstrap

Skip the chained lerna bootstrap.

Examples

# Adds the module-1 package to the packages in the 'prefix-' prefixed folders
lerna add module-1 packages/prefix-*

# Install module-1 to module-2
lerna add module-1 --scope=module-2

# Install module-1 to module-2 in devDependencies
lerna add module-1 --scope=module-2 --dev

# Install module-1 in all modules except module-1
lerna add module-1

# Install babel-core in all modules
lerna add babel-core
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文