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