mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35: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 = {
|
||||
filename: 'types/vue-shim.d.ts',
|
||||
getContents: () =>
|
||||
[
|
||||
getContents: ({ nuxt }) => {
|
||||
if (!nuxt.options.typescript.shim) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return [
|
||||
'declare module \'*.vue\' {',
|
||||
' import { DefineComponent } from \'vue\'',
|
||||
' const component: DefineComponent<{}, {}, any>',
|
||||
' export default component',
|
||||
'}'
|
||||
].join('\n')
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Use an alias
|
||||
|
Loading…
Reference in New Issue
Block a user