How to publish a npm package with distribution files?

后端 未结 3 916
挽巷
挽巷 2020-12-02 07:32

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

3条回答
  •  情深已故
    2020-12-02 08:14

    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

提交回复
热议问题