Skip to content

Commit

Permalink
Store local yarn versions as .cjs files (#8145)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bgotink committed May 25, 2020
1 parent 17992a7 commit fc8489a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa

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

- Generates local yarn verions as `.cjs` files when calling `yarn set version`

[#8145](https://github.com/yarnpkg/yarn/pull/8145) - [**bgotink**](https://github.com/bgotink)

## 1.22.1

- Prevents `yarn-path` from exiting before its child exited
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/policies.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const {run, setFlags, examples} = buildSubCommands('policies', {

const bundle = await fetchBundle(config, bundleUrl);

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

0 comments on commit fc8489a

Please sign in to comment.