Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: don't split tsconfig.dom.json into two files #11

Merged
merged 1 commit into from
Apr 23, 2023
Merged
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
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ Add one of the available configurations to your `tsconfig.json`:
### Configuration for Browser Environment

```json
"extends": [
"@vue/tsconfig/tsconfig.json",
"@vue/tsconfig/tsconfig.dom.json"
]
"extends": "@vue/tsconfig/tsconfig.dom.json"
```

### Configuration for Node Environments
Expand Down Expand Up @@ -56,31 +53,20 @@ Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node18/tscon
## Migrating from TypeScript < 5.0

- The usage of base `tsconfig.json` is unchanged.
- `tsconfig.web.json` is now renamed to `tsconfig.dom.json`, to align with `@vue/runtime-dom` and `@vue/compiler-dom`, and it only contains dom-specific options, you need to use it in conjunction with the base `tsconfig.json`:

```json
"extends": [
"@vue/tsconfig/tsconfig.json",
"@vue/tsconfig/tsconfig.dom.json"
]
```

- `tsconfig.web.json` is now renamed to `tsconfig.dom.json`, to align with `@vue/runtime-dom` and `@vue/compiler-dom`.
- `tsconfig.node.json` is removed, please read the [Node.js section](#configuration-for-node-environments) above for Node.js usage.

Some configurations have been updated, which might affect your projects:

- `moduleResolution` changed from `node` to [`bundler`](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#moduleresolution-bundler)
- The `lib` option in `tsconfig.dom.json` now includes `ES2020` by default.
- The `lib` option in `tsconfig.dom .json` now includes `ES2020` 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.
- 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
{
"extends": [
"@vue/tsconfig/tsconfig.json",
"@vue/tsconfig/tsconfig.dom.json"
],
"extends": "@vue/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"lib": ["ES2016", "DOM", "DOM.Iterable"]
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.dom.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"lib": [
// Target ES2020 to align with Vite.
Expand Down