タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

yarnに関するhiro14akiのブックマーク (4)

  • yarnのhoistingを理解する

    yarnのv3がそろそろ来そうな気配を感じるものの、恐らくまだしばらくはnode_modulesと付き合う事になりそうなので、今一度yarnにおけるnode_modulesのhoistingについて理解しなおそう、ということを試みた記事です。 前半はhoistってそもそも何?的な話で、後半は仕組みの話です。 後半まで飛ばしたいかたはこちらからどぞ。 yarnにおけるhoistingとは transitive dependenciesをより上位のディレクトリにhoist(巻き上げ)すること。 transitive dependeniesって? 推移的である依存関係のこと。(日語の正式名称的なものがあるのかどうかは知らない。たぶんなさそう) 推移的であるとはどういうことか、一階述語論理で書くと以下のようになる。 Note: 一階述語論理とは?については以前記事を書いたので参考にどぞ RRRを

    yarnのhoistingを理解する
  • Yarn のワークスペースの初歩 - 30歳からのプログラミング

    Yarn にはワークスペースという機能があり、これを使うとひとつのリポジトリで複数の npm パッケージを開発できるようになり、効率的に作業を進められるようになる。 この記事の内容は、Yarn のv1.22.4で動作確認している。 シンボリックリンクが作られ、パッケージをまたいだ開発をしやすくなる ワークスペースをつかうためには、リポジトリのルートディレクトリにpackage.jsonを作成し、workspacesフィールドを指定する必要がある。 また、このディレクトリをパッケージとして公開することはないので、privateフィールドをtrueにしておく。 { "private": true, "workspaces": ["project-a"] } 上記の例では、project-aというディレクトリを、ワークスペースの対象としている。 次に、以下の内容の./project-a/pack

    Yarn のワークスペースの初歩 - 30歳からのプログラミング
    hiro14aki
    hiro14aki 2021/11/10
    ワークスペース構成
  • Yarn

    For Yarn 2+ docs and migration guide, see yarnpkg.com. Yarn supports selective version resolutions, which lets you define custom package versions or ranges inside your dependencies through the resolutions field in your package.json file. Normally, this would require manual edits in the yarn.lock file. See the Selective Versions Resolutions RFC for the full spec. Why would you want to do this? You

    Yarn
    hiro14aki
    hiro14aki 2020/01/14
    強制的にパッケージをインストールするために resolutions を使う
  • Yarn

    Migrating from npm should be a fairly easy process for most users. Yarn can consume the same package.json format as npm, and can install any package from the npm registry. If you want to try Yarn out on your existing npm project, just try running: This will lay out your node_modules folder using Yarn’s resolution algorithm that is compatible with the node.js module resolution algorithm. If you get

    Yarn
  • 1