Problem
I have follow package.json looks good in npm. However, I figure out there is problem.
{
"name": "@scope/package",
"version": "0.1.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
...
}
The distributed package only includes index.js !
After several research. There is some finding, npm. will looking for .gitignore if .npmignore not found.
To Fix It
Add files array with dist folder
"name": "@scope/package",
"version": "0.1.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
]
Finally