mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 15:42:09 +00:00
fix(bridge): ensure vue
ts alias points to original vue (#1924)
This commit is contained in:
parent
36f3691bf8
commit
4b367a1959
@ -127,10 +127,17 @@ If you are using TypeScript, you can edit your `tsconfig.json` to benefit from a
|
|||||||
+ "extends": "./.nuxt/tsconfig.json",
|
+ "extends": "./.nuxt/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
...
|
...
|
||||||
}
|
},
|
||||||
|
+ "vueCompilerOptions": {
|
||||||
|
+ "experimentalCompatMode": 2,
|
||||||
|
+ }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
::alert
|
||||||
|
You may also need to add `@vue/runtime-dom` as a devDependency if you are struggling to get template type inference working with [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar).
|
||||||
|
::
|
||||||
|
|
||||||
## Migrate Composition API
|
## Migrate Composition API
|
||||||
|
|
||||||
If you were previously using `@vue/composition-api` or `@nuxtjs/composition-api`, please read the [composition api migration guide](/getting-started/bridge-composition-api).
|
If you were previously using `@vue/composition-api` or `@nuxtjs/composition-api`, please read the [composition api migration guide](/getting-started/bridge-composition-api).
|
||||||
|
@ -50,6 +50,17 @@ export function setupAppBridge (_options: any) {
|
|||||||
nuxt.options.alias[alias] = nuxt.options.alias['vue2-bridge']
|
nuxt.options.alias[alias] = nuxt.options.alias['vue2-bridge']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure TS still recognises vue imports
|
||||||
|
nuxt.hook('prepare:types', ({ tsConfig }) => {
|
||||||
|
tsConfig.compilerOptions.paths.vue2 = ['vue']
|
||||||
|
delete tsConfig.compilerOptions.paths.vue
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
tsConfig.vueCompilerOptions = {
|
||||||
|
experimentalCompatMode: 2
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// Deprecate various Nuxt options
|
// Deprecate various Nuxt options
|
||||||
if (nuxt.options.globalName !== 'nuxt') {
|
if (nuxt.options.globalName !== 'nuxt') {
|
||||||
throw new Error('Custom global name is not supported by @nuxt/bridge.')
|
throw new Error('Custom global name is not supported by @nuxt/bridge.')
|
||||||
|
Loading…
Reference in New Issue
Block a user