1. Configuration

1. Configuration

Configuring your package

Yarn looks for package.json files to identify each package and configure the behavior of yarn while running inside that package.

An example configuration for the pet-kitten package, which would be found at pet-kitten/package.json:

{
  "name": "pet-kitten",
  "version": "0.1.0",
  "main": "pet.js",
  "dependencies": {
    "hand": "1.0.0"
  }
}

Use yarn.lock to pin your dependencies

Yarn also uses a yarn.lock file in the root of your project to make dependency resolution fast and reliable. You never need to touch this file- yarn owns it and will change it when managing dependencies.

To make sure your app works consistently, you should always save the yarn.lock file in your code repository.

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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部