Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
How to get global references from a vite lib build

I will try to start with an example that works. If I want to refer or get code intellisense from a lib a an arbitrary js file that use global I can simply use the /// (triple dash). Like in <reference path="../jquery.js"/> now I can see all types as if it is a global.

I am outputting umd and es. either way would be fine.

For example I have a umd/es build that exports two functions: 'addData' 'getData' How can I have a reference to those from an file without importing the actual lib? same as we can do with the ///<reference for JQuery.

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

for anyone wondering the same.

You can define your own d.ts files and put the file in your package.json. In my case I created a file index.d.ts in the src folder which I also copy to the dist when building.

and in the package.json: "types": "./path/index.d.ts"

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda