Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!