Skip to content

Commit

Permalink
fix(nuxt): generate empty file when shim is disabled (#23333)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored and manniL committed Dec 11, 2023
1 parent 4a8c306 commit 68b4fe8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/nuxt/src/core/templates.ts
Expand Up @@ -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
Expand Down

0 comments on commit 68b4fe8

Please sign in to comment.