简体   繁体   English

如何嵌套 NPM 项目

[英]How to nest NPM projects

I want to nest a second NPM repository inside the current repository.我想在当前存储库中嵌套第二个 NPM 存储库。 Is it possible to create another repo inside an existing repo without inheriting dependencies?是否可以在现有仓库中创建另一个仓库而不继承依赖关系?

I'm asking this so that I can separate my API and static files我问这个是为了分开我的 API 和 static 文件

It's a good idea to have a seperate project for your API.为您的 API 有一个单独的项目是个好主意。 Having it in the same project as your frontend might cause your some trouble when trying to deploy it to a server, or to multiple server for that mather.将它与前端放在同一个项目中可能会在尝试将其部署到服务器或该mather的多个服务器时给您带来一些麻烦。 In term of NPM, as long as you don't import package from the parent, they should be completly independant.就 NPM 而言,只要您不从父级导入 package,它们应该是完全独立的。 Make sure it is in a subfolder though.确保它在一个子文件夹中。

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

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