When you npm publish
, if you don't have an .npmignore
file, npm will use your .gitignore
file (in your case you excluded the dist
folder).
To solve your problem, create a .npmignore
file based on your .gitignore
file, without ignoring the dist folder.
Soure : https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package
Take a look at the "files" field of package.json file https://docs.npmjs.com/files/package.json#files
From the documentation:
The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With