简体   繁体   English

构建后删除 node_modules 文件夹

[英]Remove node_modules folder after building

is it dangerous to keep the folder node_modules on the prod server after building the app.js?构建 app.js 后将文件夹 node_modules 保留在产品服务器上是否危险? Or should I delete the folder after building?.或者我应该在构建后删除文件夹? The node_modules folder is not public. node_modules 文件夹不公开。

If your build process uses webpack (or equivalent) to generate the distributable js, you dont need to keep node_modules at all.如果您的构建过程使用 webpack(或等效)来生成可分发的 js,则根本不需要保留 node_modules。

Welcome to StackOverflow, dfgdghjezfghfgdh!欢迎来到 StackOverflow,dfgdghjezfghfgdh!

Generally speaking, as the folder is not public, you don't need to worry about it existing in the file system.一般来说,由于该文件夹不是公开的,因此您不必担心它是否存在于文件系统中。 Depending on how your project is built you might even require it in your production environment as well.根据您的项目的构建方式,您甚至可能在生产环境中也需要它。

Hope this helped.希望这有帮助。

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

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