mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 13:48:13 +00:00
fix(nuxt): generate empty file when shim is disabled (#23333)
This commit is contained in:
parent
dd0ffaa84c
commit
a2fb8234ac
@ -18,14 +18,19 @@ interface TemplateContext {
|
|||||||
|
|
||||||
export const vueShim: NuxtTemplate = {
|
export const vueShim: NuxtTemplate = {
|
||||||
filename: 'types/vue-shim.d.ts',
|
filename: 'types/vue-shim.d.ts',
|
||||||
getContents: () =>
|
getContents: ({ nuxt }) => {
|
||||||
[
|
if (!nuxt.options.typescript.shim) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
'declare module \'*.vue\' {',
|
'declare module \'*.vue\' {',
|
||||||
' import { DefineComponent } from \'vue\'',
|
' import { DefineComponent } from \'vue\'',
|
||||||
' const component: DefineComponent<{}, {}, any>',
|
' const component: DefineComponent<{}, {}, any>',
|
||||||
' export default component',
|
' export default component',
|
||||||
'}'
|
'}'
|
||||||
].join('\n')
|
].join('\n')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use an alias
|
// TODO: Use an alias
|
||||||
|
Loading…
Reference in New Issue
Block a user