mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(schema): disable typescript.shim
in favour of volar (#26052)
This commit is contained in:
parent
375bd64c5b
commit
280d30d5e1
@ -22,7 +22,7 @@ Start with one of our starters and themes directly by opening [nuxt.new](https:/
|
|||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
|
|
||||||
- **Node.js** - [`v18.0.0`](https://nodejs.org/en) or newer
|
- **Node.js** - [`v18.0.0`](https://nodejs.org/en) or newer
|
||||||
- **Text editor** - We recommend [Visual Studio Code](https://code.visualstudio.com/) with the [Volar Extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
|
- **Text editor** - We recommend [Visual Studio Code](https://code.visualstudio.com/) with the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously known as Volar)
|
||||||
- **Terminal** - In order to run Nuxt commands
|
- **Terminal** - In order to run Nuxt commands
|
||||||
|
|
||||||
::note
|
::note
|
||||||
@ -30,17 +30,6 @@ Start with one of our starters and themes directly by opening [nuxt.new](https:/
|
|||||||
:summary[Additional notes for an optimal setup:]
|
:summary[Additional notes for an optimal setup:]
|
||||||
- **Node.js**: Make sure to use an even numbered version (18, 20, etc)
|
- **Node.js**: Make sure to use an even numbered version (18, 20, etc)
|
||||||
- **Nuxtr**: Install the community-developed [Nuxtr extension](https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode)
|
- **Nuxtr**: Install the community-developed [Nuxtr extension](https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode)
|
||||||
- **Volar**: Either enable [**Take Over Mode**](https://vuejs.org/guide/typescript/overview.html#volar-takeover-mode) (recommended) or add the [TypeScript Vue Plugin](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)
|
|
||||||
|
|
||||||
If you have enabled **Take Over Mode** or installed the **TypeScript Vue Plugin (Volar)**, you can disable generating the shim for `*.vue` files in your [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file:
|
|
||||||
|
|
||||||
```ts twoslash [nuxt.config.ts]
|
|
||||||
export default defineNuxtConfig({
|
|
||||||
typescript: {
|
|
||||||
shim: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import { addPluginTemplate } from 'nuxt/kit'
|
import { addPluginTemplate } from 'nuxt/kit'
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
typescript: { shim: process.env.DOCS_TYPECHECK === 'true' },
|
||||||
pages: process.env.DOCS_TYPECHECK === 'true',
|
pages: process.env.DOCS_TYPECHECK === 'true',
|
||||||
modules: [
|
modules: [
|
||||||
function () {
|
function () {
|
||||||
|
@ -50,9 +50,9 @@ export default defineUntypedSchema({
|
|||||||
/**
|
/**
|
||||||
* Generate a `*.vue` shim.
|
* Generate a `*.vue` shim.
|
||||||
*
|
*
|
||||||
* We recommend instead either enabling [**Take Over Mode**](https://vuejs.org/guide/typescript/overview.html#volar-takeover-mode) or adding
|
* We recommend instead letting the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
|
||||||
* TypeScript Vue Plugin (Volar)** 👉 [[Download](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)].
|
* generate accurate types for your components.
|
||||||
*/
|
*/
|
||||||
shim: true
|
shim: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user