Skip to content

Commit fc8489a

Browse files
authored
Store local yarn versions as .cjs files (#8145)
This improves the experience of working with yarn in workspaces that are marked as "type": "module" in the package.json file. This change has also been applied in yarn 2, see yarnpkg/berry#1354
1 parent 17992a7 commit fc8489a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa
1212

1313
[#8142](https://github.com/yarnpkg/yarn/pull/8142) - [**Merceyz**](https://github.com/merceyz)
1414

15+
- Generates local yarn verions as `.cjs` files when calling `yarn set version`
16+
17+
[#8145](https://github.com/yarnpkg/yarn/pull/8145) - [**bgotink**](https://github.com/bgotink)
18+
1519
## 1.22.1
1620

1721
- Prevents `yarn-path` from exiting before its child exited

src/cli/commands/policies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const {run, setFlags, examples} = buildSubCommands('policies', {
155155

156156
const bundle = await fetchBundle(config, bundleUrl);
157157

158-
const yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-${bundleVersion}.js`);
158+
const yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-${bundleVersion}.cjs`);
159159
reporter.log(`Saving it into ${chalk.magenta(yarnPath)}...`);
160160
await fs.mkdirp(path.dirname(yarnPath));
161161
await fs.writeFile(yarnPath, bundle);

0 commit comments

Comments
 (0)