You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**What's the problem this PR addresses?**
The `yarn.config.cjs` file doesn't work with projects using `type:
"module"`.
Fixes#5720
**How did you fix it?**
Renames the file into `yarn.config.cjs`. Since it never got released in
a stable release, it should be acceptable to do so without backward
compatibility.
**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
Copy file name to clipboardExpand all lines: packages/docusaurus/docs/features/constraints.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ It currently doesn't support the following, but might in the future (PRs welcome
27
27
28
28
## Creating a constraint
29
29
30
-
Constraints are created by adding a `yarn.config.js` file at the root of your project (repository). This file should export an object with a `constraints` method. This method will be called by the constraints engine, and must define the rules to enforce on the project, using the provided API.
30
+
Constraints are created by adding a `yarn.config.cjs` file at the root of your project (repository). This file should export an object with a `constraints` method. This method will be called by the constraints engine, and must define the rules to enforce on the project, using the provided API.
31
31
32
-
For example, the following `yarn.config.js` will enforce that all `react` dependencies are set to `18.0.0`.
32
+
For example, the following `yarn.config.cjs` will enforce that all `react` dependencies are set to `18.0.0`.
33
33
34
34
```ts
35
35
module.exports= {
@@ -80,7 +80,7 @@ Yarn ships types that make it easier to write constraints. To use them, add the
80
80
$ yarn add @yarnpkg/types
81
81
```
82
82
83
-
Then, in your `yarn.config.js` file, import the types, in particular the `defineConfig` function which automatically type the configuration methods:
83
+
Then, in your `yarn.config.cjs` file, import the types, in particular the `defineConfig` function which automatically type the configuration methods:
Copy file name to clipboardExpand all lines: packages/docusaurus/static/configuration/yarnrc.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@
89
89
"constraintsPath": {
90
90
"_package": "@yarnpkg/plugin-constraints",
91
91
"title": "Path of the constraints file.",
92
-
"description": "This only matters for Prolog constraints, which are being deprecated. JavaScript constraints will always be read from the `yarn.config.js` file.",
92
+
"description": "This only matters for Prolog constraints, which are being deprecated. JavaScript constraints will always be read from the `yarn.config.cjs` file.",
0 commit comments