Skip to content

Enforce hoisting of some packages to fix giant disk size with Yarn #1397

Closed
@gaearon

Description

@gaearon

Yarn has known issues deduplicating dependencies, sometimes failing to hoist dependencies shared between a ton of packages (such as babel-runtime) and producing installs 5 times bigger than npm: yarnpkg/yarn#2306.

While we could disable Yarn integration (#1390), I'd like to explore an alternative approach. We should be able to determine which package causes most duplication, and then hoist it manually by making it an explicit dependency of react-scripts. This would ensure Yarn deduplicates it. This is a temporary workaround until Yarn actually fixes the algorithm (tracked in yarnpkg/yarn#2306).

Please don't hesitate to help with this. You would need to:

  1. Reproduce the issue with giant (~1GB) install locally with Yarn.
  2. Figure out which dependencies get duplicated. (I don't know the easiest way but you could probably look at Babel packages and see which dependencies end up in node_modules of each of them.)
  3. Add the duplicated dependencies to react-scripts itself to hoist them.
  4. Verify that the issue is resolved.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions