Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda