yarn run

yarn run

Runs a defined package script.

You may define scripts in your package.json file.

{
  "name": "my-package",
  "scripts": {
    "build": "babel src -d lib",
    "test": "jest"
  }
}

yarn run [script] [-- <args>]

If you have defined a scripts object in your package, this command will run the specified [script]. For example:

yarn run test

Running this command will execute the script named "test" in your package.json.

You can pass additional arguments to your script by using --.

yarn run test -- -o --watch

Running this command will execute jest -o --watch.

[script] can also be any locally installed executable that is inside node_modules/.bin/.

yarn run

If you do not specify a script to the yarn run command, the run command will list all of the scripts available to run for a package.

© 2016–2017 Yarn Contributors
Licensed under the BSD License.
https://yarnpkg.com/en/docs/cli/run

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部