Skip to content

How to add types for virtual modules? #11368

Answered by chenxch
Lisianthus-A asked this question in Q&A
Discussion options

You must be logged in to vote

You need to add the type declaration.

// module.d.ts
declare module 'virtual:*' {
  // eslint-disable-next-line
  const component: any;
  export default component;
}

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@Lisianthus-A
Comment options

@benjaminpreiss
Comment options

@Lisianthus-A
Comment options

Answer selected by Lisianthus-A
Comment options

You must be logged in to vote
2 replies
@IARI
Comment options

@EdwardLemayDev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants