What does yarn --prefer-offline do?

前端 未结 3 2046
旧巷少年郎
旧巷少年郎 2021-02-20 05:19

I assume when I install npm package say react for the first time with

yarn add react

this will save react file in local cache. I found .y

3条回答
  •  误落风尘
    2021-02-20 05:28

    A quite popular guy here at S.O. said:

    "Read the Source, Luke!"

    And here is the source of yarn CLI's --prefer-offline flag:

    commander.option('--prefer-offline', 'use network only if dependencies are not available in local cache');
    

    Enjoy!

提交回复
热议问题