bundledDependencies相对于npm中常规依赖项的优势 [英] Advantages of bundledDependencies over normal dependencies in npm

查看:393
本文介绍了bundledDependencies相对于npm中常规依赖项的优势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm允许我们指定 bundledDependencies ,但是这样做的好处是什么?我猜想我们是否要绝对确保即使删除了我们引用的模块也能得到正确的版本,或者捆绑有速度上的好处?

npm allows us to specify bundledDependencies, but what are the advantages of doing so? I guess if we want to make absolutely sure we get the right version even if the module we reference gets deleted, or perhaps there is a speed benefit with bundling?

任何人都知道 bundledDependencies 优于普通依赖项的优势?

Anyone know the advantages of bundledDependencies over normal dependencies?

推荐答案

最大的解决方案之一Node目前面临的问题是它的变化速度如何。这意味着生产系统可能非常脆弱,并且 npm更新可以轻松破坏事物。

One of the biggest problems right now with Node is how fast it is changing. This means that production systems can be very fragile and an npm update can easily break things.

使用bundledDependencies是一个解决这个问题的方法是,确保您正确推测,无论其他情况如何变化,始终将提供正确的依赖项。

Using bundledDependencies is a way to get round this issue by ensuring, as you correctly surmise, that you will always deliver the correct dependencies no matter what else may be changing.

您还可以使用此方法捆绑您自己的私人捆绑包,并随安装一起提供。

You can also use this to bundle up your own, private bundles and deliver them with the install.

这篇关于bundledDependencies相对于npm中常规依赖项的优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆