简体   繁体   English

部署在NX monorepo中创建的nestjs服务器

[英]Deploying nestjs server created in NX monorepo

I have a NX monorepo containing mostly Angular front end code that we've since added a express server and I'm trying to figure out how to deploy it. 我有一个主要包含Angular前端代码的NX monorepo,此后我们已经添加了Express服务器,并且我试图弄清楚如何部署它。 The problem is how to separate out the vendor based code from node modules that's just for the server application. 问题是如何从仅用于服务器应用程序的节点模块中分离出基于供应商的代码。

Typically with a typical Angular app we have a vendor file containing all the 3rd party dependencies, and historically for are server apps they would have their own package.json that we can just install locally at build. 通常,对于典型的Angular应用程序,我们会提供一个包含所有第3方依赖关系的供应商文件,从历史上看,对于服务器应用程序,它们将具有自己的package.json,我们可以在构建时在本地安装它们。 I'm assuming their is a way to solve this but I haven't found any reference to it. 我假设他们是解决此问题的一种方法,但我没有找到任何参考。 I'd really rather not take the entire node modules folder and place it on the server, nor create a separate package.json that only references the server code. 我真的不希望整个节点模块文件夹都放在服务器上,也不要创建单独的package.json只引用服务器代码。

Any help is appreciated, thank you 任何帮助表示赞赏,谢谢

The solution I found is that there is an configuration for the builder in angular.json. 我发现的解决方案是在angular.json中有一个针对构建器的配置。 If you set 如果您设定

"externalDependencies": "none"

then the output will be a single file containing all the dependencies included. 那么输出将是一个包含所有依赖项的单个文件。

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

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