简体   繁体   English

在同一应用程序上拥有多个package.json文件是否有好处?

[英]Is there a benefit to having multiple package.json files on the same application?

I am building my very first full react web application from back to front. 我正在从头到尾构建我的第一个完全反应Web应用程序。 Up until now, I have been completing a lot of assignments that have been partially created for me. 到目前为止,我已经完成了许多为我部分创建的任务。

In my current set up, I noticed that somehow I have a package.json file in both my root directory and my client directory. 在当前设置中,我注意到以某种方式在根目录和客户端目录中都有package.json文件。 Is there a benefit to having multiple? 拥有多个有好处吗? Or can I put everything in my root directory? 还是可以将所有内容放在根目录中?

Thank you! 谢谢!

It's up to you and what you plan to do with your project. 这取决于您以及您打算如何处理项目。 It can be beneficial for production (and debugging) purposes to separate your front- and back-end dependencies. 对于生产(和调试)目的而言,分离前端和后端依赖关系可能是有益的。 If you are working on a quick hobby project, there may be little benefit from this separation. 如果您正在从事一项快速的业余项目,则这种分离可能没有多大好处。

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

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