javascript - 在 ReactJS 应用程序的生产环境中添加源映射对性能有影响吗?
问题描述
由于额外的服务器往返,源地图是否会影响应用程序加载时间?如果我们删除/禁用源映射,那么会有任何性能/应用程序加载时间优势吗?
它还会增加捆绑包的大小吗?
谢谢,拉梅什
解决方案
Here is a link to MDN on the subject, https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map
If you are adding the source maps via the commented notation, then no there will be zero impact, other than the weight of the bytes added by the comment :-)
But if you add source maps as a resource in a JavaScript file or in your HTML, then yes, the browser loads all resources linked to.
I hope that makes sense.
推荐阅读
- scala - 合并scala映射并根据条件更新公共密钥
- php - 如何优化显示数千条数据的长查询
- java - 如何使用angular7在网页中显示值
- java - 如果我们更改字符串的值,则会创建一个新对象。那么我们如何访问之前的字符串对象
- haskell - 如何以良好的运行速度将列表评估为正常形式?
- azure - 我们如何在 Azure 搜索中使用 Application Insight 遥测数据?
- xamarin.forms - PRISM 模块化依赖项
- overlay - 覆盖资产操作栏的“属性”按钮
- swift - 如何在 Xcode 10 (macOS) 的 Storyboard 中将 NSArrayController 绑定到应用程序委托上的属性?
- python-3.x - 扫描字符串文字时出现python语法错误EOL