V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
xcodebuild

写了个简单的 yarn 加速

  •  
  •   xcodebuild ·
    xcodebuild · Apr 1, 2021 · 4176 views
    This topic created in 1860 days ago, the information mentioned may be changed or developed.

    之前一直用 cnpm,但是有些工具链和 cnpm 有些奇怪的冲突,只能用 yarn 。

    而 yarn 仅仅设置 taobao 源的情况下,很多二进制( electron,node-sass )其实还是走的外网地址。设置这些二进制 mirror 又极其麻烦。然后发现了 https://github.com/best-shot/bin-wrapper-china 这个项目解决了这个痛点问题。

    总是改 package.json 和写环境变量太麻烦,所以写了个小工具 https://github.com/xcodebuild/fastyarn 封装了一下,没几行代码,需要的话自取

    使用

    # 安装
    npm install -g yarn fyarn --registry "https://r.cnpmjs.org/"
    
    # 使用
    fyarn install
    
    6 replies    2021-04-05 16:41:41 +08:00
    Tokin
        1
    Tokin  
       Apr 1, 2021
    想到昨天翻以前写的老项目,老项目是用 sqlite3 写的,结果 sqlite3 死活装不上,气的我把项目改成了 mysql,虽然那是一个吃灰不会再使用的老项目。。。
    fjc0k
        2
    fjc0k  
       Apr 1, 2021
    哈哈,我也做了个差不多的,npm 、npx 、pnpm 、yarn 、nvm 、node-sass 、Electron 、Puppeteer 、Cypress 、Sharp 加速可以试试: https://github.com/fjc0k/tbify
    xyxc0673
        3
    xyxc0673  
       Apr 2, 2021
    谢谢分享,马克一下
    yazoox
        4
    yazoox  
       Apr 3, 2021
    厉害啊
    Outshine
        5
    Outshine  
       Apr 4, 2021
    你说的这些源,华为都有

    https://mirrors.huaweicloud.com/
    xcodebuild
        6
    xcodebuild  
    OP
       Apr 5, 2021
    @Outshine 用哪个国内源都可以哈,其实主要是 binary 的 mirror 设置太麻烦,搞定这个其他的都不是问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2546 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 11:01 · PVG 19:01 · LAX 04:01 · JFK 07:01
    ♥ Do have faith in what you're doing.