I would like to publish a npm package that contains my source as well as distribution files. My Github repository contains src
folder which contains JavaScript
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