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

176
Visualizações
npm not downloading .d.ts files

I have a components lib with a dist folder having an index.js file and some .d.ts files, when I add this lib to a project and look the node_modules folder, inside the /dist folder there is only the index.js file and none of the .d.ts were downloaded. How can i fix it? I need to distribute .d.ts together with the lib.

What i have inside package.json:

{
  "name": "webpack-ts-2",
  "version": "1.0.0",
  "description": "",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "scripts": {
    "build": "webpack",
    "test": "echo \"Error: no test specified\" && exit 1",
    "tsc": "tsc"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@types/react": "^17.0.30",
    "ts-loader": "^9.2.6",
    "typescript": "^4.4.4",
    "webpack": "^5.58.2",
    "webpack-cli": "^4.9.0"
  },
  "peerDependencies": {
    "react": "*"
  },
  "files": ["./dist"]
}

When i run npm pack i just got it, but there is no index.d.ts

-package
 -dist
  -index.js
 -package.json
about 4 years ago · Juan Pablo Isaza
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