Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Add one of the available configurations to your `tsconfig.json`:
First install the base tsconfig and types for the Node.js version you are targeting, for example:

```sh
npm add -D @tsconfig/node22 @types/node@22
npm add -D @tsconfig/node24 @types/node@24
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor aside just because 24 is the new LTS as of yesterday

```

If you are not using any bundlers, the Node.js code doesn't rely on any Vue/Vite-specific features, then these would be enough, you may not need to extend the Vue TSConfig:

```json
"extends": "@tsconfig/node22/tsconfig.json",
"extends": "@tsconfig/node24/tsconfig.json",
"compilerOptions": {
"types": ["node"]
}
Expand All @@ -50,15 +50,15 @@ Otherwise, if you are trying to use Vue components in Node.js environments (e.g.

```json
"extends": [
"@tsconfig/node22/tsconfig.json",
"@tsconfig/node24/tsconfig.json",
"@vue/tsconfig/tsconfig.json"
],
"compilerOptions": {
"types": ["node"]
}
```

Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node22/tsconfig.json` so that it takes precedence.
Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node24/tsconfig.json` so that it takes precedence.

## Emitting Declaration Files

Expand Down Expand Up @@ -86,9 +86,9 @@ Some configurations have been updated, which might affect your projects:
- While `vue-i18n` [has fixed this issue in v9.3 beta](https://github.com/intlify/vue-i18n-next/issues/1327#issuecomment-1539491735), and vuetify [will solve the issue in v3.3](https://github.com/vuetifyjs/vuetify/commit/5e08832fabe80ddc839907d13c7279a091ddfee5), other packages may not be so quick to fix. In that case, you can override the `compilerOptions.resolvePackageJsonExports` option to `false` in your `tsconfig.json` to temporarily work around the issue.
- But we encourage you to submit PRs to these packages to fix the bugs, so that we can all move forward to the new resolution mode. You can use tools like [`publint`](https://publint.dev/) and [Are the types wrong?](https://arethetypeswrong.github.io/) to help you find and debug the issues.
- Another small breaking change is that `--moduleResolution bundler` does not support resolution of `require` calls. In TypeScript files, this means the `import mod = require("foo”)` syntax is forbidden.
- The `lib` option in `tsconfig.dom.json` now includes `ES2020` by default.
- The `lib` option in `tsconfig.dom.json` now includes `ES2022` by default.
- Previously it was ES2016, which was the lowest ES version that Vue 3 supports.
- Vite 4 transpiles down to ES2020 by default, this new default is to align with the build tool.
- Vite 4 transpiles down to ES2020 by default, and Vite 7 transpiles down to baseline. The defaults are to align with the build tool.
- This change won't throw any new errors on your existing code, but if you are targeting old browsers and want TypeScript to throw errors on newer features used, you can override the `lib` option in your `tsconfig.json`:

```json
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.dom.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"lib": [
// Target ES2020 to align with Vite.
// Target ES2022 to align with Vite.
// <https://vite.dev/config/build-options.html#build-target>
// Support for newer versions of language built-ins are
// left for the users to include, because that would require:
// - either the project doesn't need to support older versions of browsers;
// - or the project has properly included the necessary polyfills.
"ES2020",
"ES2022",

"DOM",
"DOM.Iterable"
Expand Down