diff --git a/.yarn/versions/f73c4856.yml b/.yarn/versions/f73c4856.yml new file mode 100644 index 000000000000..74cb95ae1249 --- /dev/null +++ b/.yarn/versions/f73c4856.yml @@ -0,0 +1,5 @@ +releases: + "@yarnpkg/plugin-nm": major + +declined: + - "@yarnpkg/cli" diff --git a/CHANGELOG.md b/CHANGELOG.md index af401a99632c..276677793918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https: - Plugins cannot access the Clipanion 2 APIs anymore (upgrade to [Clipanion 3](https://github.com/arcanis/clipanion)) - Plugins cannot access the internal copy of Yup anymore (use [Typanion](https://github.com/arcanis/typanion) instead) - The network settings configuration option has been renamed from `caFilePath` to `httpsCaFilePath`. +- Set `nmMode` to `hardlinks-local` by default. ### **API Changes** diff --git a/packages/gatsby/static/configuration/yarnrc.json b/packages/gatsby/static/configuration/yarnrc.json index 2cbd14042d27..950b89dd1eb4 100644 --- a/packages/gatsby/static/configuration/yarnrc.json +++ b/packages/gatsby/static/configuration/yarnrc.json @@ -407,7 +407,7 @@ "description": "If set to `hardlinks-local` Yarn will utilize hardlinks to reduce disk space consumption inside `node_modules` directories in a current project. With `hardlinks-global` Yarn will use global content addressable storage to reduce `node_modules` size across all the projects using this option.", "type": "string", "enum": ["classic", "hardlinks-local", "hardlinks-global"], - "default": "classic" + "default": "hardlinks-local" }, "nodeLinker": { "_package": "@yarnpkg/plugin-pnp", diff --git a/packages/plugin-nm/sources/NodeModulesLinker.ts b/packages/plugin-nm/sources/NodeModulesLinker.ts index f46bbd4888f2..3a15e10c7d42 100644 --- a/packages/plugin-nm/sources/NodeModulesLinker.ts +++ b/packages/plugin-nm/sources/NodeModulesLinker.ts @@ -473,7 +473,7 @@ async function findInstallState(project: Project, {unrollAliases = false}: {unro if (locatorState.__metadata.version > STATE_FILE_VERSION) return null; - const nmMode = locatorState.__metadata.nmMode || NodeModulesMode.CLASSIC; + const nmMode = locatorState.__metadata.nmMode || NodeModulesMode.HARDLINKS_LOCAL; const locatorMap: NodeModulesLocatorMap = new Map(); const binSymlinks: BinSymlinkMap = new Map(); diff --git a/packages/plugin-nm/sources/index.ts b/packages/plugin-nm/sources/index.ts index e149b73ad537..53f33c79b3fb 100644 --- a/packages/plugin-nm/sources/index.ts +++ b/packages/plugin-nm/sources/index.ts @@ -40,7 +40,7 @@ const plugin: Plugin = { NodeModulesMode.HARDLINKS_LOCAL, NodeModulesMode.HARDLINKS_GLOBAL, ], - default: NodeModulesMode.CLASSIC, + default: NodeModulesMode.HARDLINKS_LOCAL, }, nmSelfReferences: { description: `If set to 'false' the workspace will not be allowed to require itself and corresponding self-referencing symlink will not be created`,