1

I am trying to streamline the NPM publish process by only having to run npm publish because sometime developers might forget to specify the publish directory. For instance I have the structure:

package.json
package
src

I'm building the package directory with regular npm scripts from /src then using the prepublish hook to copy the /package.json in the /package directory. What would be great is if I can specify the /package directory in package.json for it to be used as the package to be uploaded to NPM.

I know npm publish ./package works but developers forget this step and it also adds other files to the NPM repo that dont need to be there.

Saveen
  • 4,120
  • 14
  • 38
  • 41
Raymond
  • 31
  • 1
  • 5
  • Possible duplicate of [How to npm publish specific folder but as package root](https://stackoverflow.com/questions/38935176/how-to-npm-publish-specific-folder-but-as-package-root) – Louis Aug 06 '18 at 13:56

0 Answers0