Sourcemap

Advantages

When you develop front end web applications, you would like to use ES6, Sass etc. Then you need to compile javascript into ES5 compatible form, compile sass (or scss) to css. Additionally, you may want to compress these static source for smaller size and better performance. But unfortunately, you find it hardly to seek which line exactly it is in the source code when there are errors prompt. Chrome dev tools just show the compiled and compressed code to you for debugging. It’s a nightmare because you do not know what codes are generated by framework and what codes are transformed from your code actually. Then source map come to rescue. Source map provide you the function that link the compiled and compressed code to your source code.

Description

A source map consists of a whole bunch of information that can be used to map the code within a compressed file back to it’s original source. You can specify different source map for each of your compressed files. Using source maps allows developers to maintain a straight-foward debugging environment while at the same time optimizing their size for performance.

How Browser Download Sourcemap

Sourcemaps are downloaded and attached to the browser only when opening the developer tools. Before that the browser is not aware of the sourcemap

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值