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
Copy file name to clipboardExpand all lines: docs/guide/dep-pre-bundling.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,6 @@ If for some reason you want to force Vite to re-bundle deps, you can either star
83
83
84
84
Resolved dependency requests are strongly cached with HTTP headers `max-age=31536000,immutable` to improve page reload performance during dev. Once cached, these requests will never hit the dev server again. They are auto invalidated by the appended version query if a different version is installed (as reflected in your package manager lockfile). If you want to debug your dependencies by making local edits, you can:
85
85
86
-
1. Temporarily disable cache via the Network tab of your browser devtools;
87
-
2. Restart Vite dev server with the `--force` flag to re-bundle the deps;
86
+
1. Temporarily disable cache via the Network tab of your browser devtools.
87
+
2. Restart Vite dev server with the `--force` flag to re-bundle the deps.
Copy file name to clipboardExpand all lines: docs/guide/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The supported template presets are:
44
44
## Scaffolding Your First Vite Project
45
45
46
46
::: tip Compatibility Note
47
-
Vite requires [Node.js](https://nodejs.org/en/) version 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
47
+
Vite requires [Node.js](https://nodejs.org/en/) version 20.19+, 22.12+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
Copy file name to clipboardExpand all lines: docs/guide/troubleshooting.md
+15-31Lines changed: 15 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,37 +4,6 @@ See [Rollup's troubleshooting guide](https://rollupjs.org/troubleshooting/) for
4
4
5
5
If the suggestions here don't work, please try posting questions on [GitHub Discussions](https://github.com/vitejs/vite/discussions) or in the `#help` channel of [Vite Land Discord](https://chat.vite.dev).
6
6
7
-
## CJS
8
-
9
-
### Vite CJS Node API deprecated
10
-
11
-
The CJS build of Vite's Node API is deprecated and will be removed in Vite 6. See the [GitHub discussion](https://github.com/vitejs/vite/discussions/13928) for more context. You should update your files or frameworks to import the ESM build of Vite instead.
12
-
13
-
In a basic Vite project, make sure:
14
-
15
-
1. The `vite.config.js` file content is using the ESM syntax.
16
-
2. The closest `package.json` file has `"type": "module"`, or use the `.mjs`/`.mts` extension, e.g. `vite.config.mjs` or `vite.config.mts`.
17
-
18
-
For other projects, there are a few general approaches:
19
-
20
-
-**Configure ESM as default, opt-in to CJS if needed:** Add `"type": "module"` in the project `package.json`. All `*.js` files are now interpreted as ESM and need to use the ESM syntax. You can rename a file with the `.cjs` extension to keep using CJS instead.
21
-
-**Keep CJS as default, opt-in to ESM if needed:** If the project `package.json` does not have `"type": "module"`, all `*.js` files are interpreted as CJS. You can rename a file with the `.mjs` extension to use ESM instead.
22
-
-**Dynamically import Vite:** If you need to keep using CJS, you can dynamically import Vite using `import('vite')` instead. This requires your code to be written in an `async` context, but should still be manageable as Vite's API is mostly asynchronous.
23
-
24
-
If you're unsure where the warning is coming from, you can run your script with the `VITE_CJS_TRACE=true` flag to log the stack trace:
25
-
26
-
```bash
27
-
VITE_CJS_TRACE=true vite dev
28
-
```
29
-
30
-
If you'd like to temporarily ignore the warning, you can run your script with the `VITE_CJS_IGNORE_WARNING=true` flag:
31
-
32
-
```bash
33
-
VITE_CJS_IGNORE_WARNING=true vite dev
34
-
```
35
-
36
-
Note that postcss config files do not support ESM + TypeScript (`.mts` or `.ts` in `"type": "module"`) yet. If you have postcss configs with `.ts` and added `"type": "module"` to package.json, you'll also need to rename the postcss config to use `.cts`.
0 commit comments