Is it possible to publish only dist folder to npm

Hi all,

looking forward to use github packages, and publish a library.

Finishing my first javascript package that I intend to publish on npm over github packages.
Actually it’s a library made by angular.

One thing is not clear to me. Can I made github repo with typescript files and publish just dist folder to github packages and npm? That would be just complied js and documentation, but still I would like to left typescript files in same repo.

Dist folder of course also has own package.json

What is the best way to do this to have two separate repos one with compiled js files and other with typescript files or there is option to have all in one repo just publish dist folder as package.

Thank you.

You can to do this with the files entry in package.json. Set it to "files": ["dist/*.js", "dist/**/&.js] and it should work

1 Like

Thanks for the answer.
I am not sure that I understand it well, if so that means that package.json needs to be in root but my dist folder have its own. That confuses me.

How about this package? @appnest/readme - npm

Gitgub link on their npm site is linked to repo where files are typescript, I do not see any distribution js folder there, but package is js. Is that case they do not use github packages and that is just github link or what?

Maybe you know any kind of that kind of package? Where I could see an example?