Skip to content

Commit 7fc967b

Browse files
committed
feat: set default nmMode to hardlinks-local
1 parent d1961ee commit 7fc967b

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

.yarn/versions/f73c4856.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
releases:
2+
"@yarnpkg/plugin-nm": major

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https:
1616
- Some legacy layers have been sunset:
1717
- Plugins cannot access the Clipanion 2 APIs anymore (upgrade to [Clipanion 3](https://github.com/arcanis/clipanion))
1818
- Plugins cannot access the internal copy of Yup anymore (use [Typanion](https://github.com/arcanis/typanion) instead)
19+
- Set `nmMode` to `hardlinks-local` by default.
1920

2021
### **API Changes**
2122

packages/gatsby/static/configuration/yarnrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
"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.",
408408
"type": "string",
409409
"enum": ["classic", "hardlinks-local", "hardlinks-global"],
410-
"default": "classic"
410+
"default": "hardlinks-local"
411411
},
412412
"nodeLinker": {
413413
"_package": "@yarnpkg/plugin-pnp",

packages/plugin-nm/sources/NodeModulesLinker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ async function findInstallState(project: Project, {unrollAliases = false}: {unro
473473
if (locatorState.__metadata.version > STATE_FILE_VERSION)
474474
return null;
475475

476-
const nmMode = locatorState.__metadata.nmMode || NodeModulesMode.CLASSIC;
476+
const nmMode = locatorState.__metadata.nmMode || NodeModulesMode.HARDLINKS_LOCAL;
477477

478478
const locatorMap: NodeModulesLocatorMap = new Map();
479479
const binSymlinks: BinSymlinkMap = new Map();

packages/plugin-nm/sources/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const plugin: Plugin<Hooks> = {
4040
NodeModulesMode.HARDLINKS_LOCAL,
4141
NodeModulesMode.HARDLINKS_GLOBAL,
4242
],
43-
default: NodeModulesMode.CLASSIC,
43+
default: NodeModulesMode.HARDLINKS_LOCAL,
4444
},
4545
nmSelfReferences: {
4646
description: `If set to 'false' the workspace will not be allowed to require itself and corresponding self-referencing symlink will not be created`,

0 commit comments

Comments
 (0)