简体   繁体   English

使用源代码作为npm库发布到github,但在安装时应获取dist中存在的文件

[英]Publish as npm library to github with source code but on install should get the files present in dist

我想将代码与dist文件夹一起推送到git hub,但是在输入命令npm i <github-url>我应该将文件保存到dist中存在的node_modules中。

You can create an orphan branch in your repo and only push your dist folder with package.json there. 您可以在您的仓库中创建一个孤立的分支,并且只将带有package.jsondist文件夹推package.json那里。

Then you can point NPM to install dependency from that branch 然后,您可以指向NPM从该分支安装依赖项

npm install username/repo#branchName --save

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM