用法
$ lerna create --helplerna create <name> [loc]Create a new lerna-managed packagePositionals:name The package name (including scope), which must be locally unique _and_publicly available [string] [required]loc A custom package location, defaulting to the first configured packagelocation [string]Command Options:--access When using a scope, set publishConfig.access value[choices: "public", "restricted"] [default: public]--bin Package has an executable. Customize with --bin<executableName> [default: <name>]--description Package description [string]--dependencies A list of package dependencies [array]--es-module Initialize a transpiled ES Module--homepage The package homepage, defaulting to a subpath of the rootpkg.homepage [string]--keywords A list of package keywords [array]--license The desired package license (SPDX identifier) [default: ISC]--private Make the new package private, never published--registry Configure the package's publishConfig.registry [string]--tag Configure the package's publishConfig.tag [string]--yes Skip all prompts, accepting default values
参数
| 参数 | 描述 |
|---|---|
name |
包名(Package name) |
loc |
存放 Package 的 Package Location 。该 Package Location 必须事先创建并添加到 lerna.json > packages 选项中,否则默认使用第一个。 |
选项
注意
默认创建的 Package 为 Public 的,包的
package.json没有包含private: true。示例
创建名为
utilities的 Package,并将其存放到pkgs/*这个 Package Location ```bash $ lerna create utilities pkgs
$ tree pkgs/utilities ├── README.md ├── tests │ └── utilities.test.js ├── lib │ └── utilities.js └── package.json ```
