soucemap文件相关的理解

博客讲述项目中决定在生产环境使用带原始源代码的sourcemap以便线上调试。针对有人担心影响页面性能的问题,深入研究sourcemap。介绍了sourcemap的定义、不同浏览器启用方法,还推荐相关文章探讨其是否影响页面加载性能。

最近在项目中经过各种对比webpack打包后的结果,还是决定暂时采用在生产环境使用带有orignal source code的sourcemap这样便于线上环境出错的时候调试

但是可能很多人都会有一些担心会不会影响页面性能之类的问题,所以深入研究了一下sourcemap 来澄清一下相关问题

  1. 什么是sourcemap
    “A source map provides a way of mapping code within a compressed file back to it’s original position in a source file”
  2. 怎么enable source map在不同的浏览器中?
    大家可以参考这篇github的文章,我就不直接翻译过来的https://gist.github.com/jakebellacera/336c4982194bcb02ef8a
  3. sourcemap是否会影响页面加载的性能?
    https://indepth.dev/posts/1230/source-maps-from-top-to-bottom 这篇文章还是写的比较好,给我一些启发,所以推荐大家阅读一下
    1. Chrome will only download a source map if DevTools is open (as they can be huge in size)
    2. Source maps will not appear as a network request (inside the network tab)
    3. Once you have your source map you can add breakpoints inside the “source” code (found under sources tab).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值