微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 如何读取Base64 VLQ代码?

我试图了解css源地图的工作原理.我创建了一个非常简单的scss文件.
#navbar {
    color: black;
}

当我编译上面的scss时,我得到以下映射文件.

{
"version": "3","mappings": "AAAA,OAAQ;EACP,KAAK,EAAE,KAAK","sources": ["test.scss"],"file": "test.css"
}

当我解码“映射”时,我得到以下值.

0) [0,0],[7,8]
1) [2,1,-7],[5,5],[2,2],5]

这些价值观是什么?

解决方法

我在 http://www.thecssninja.com/javascript/source-mapping的“Base64 VLQ和保持源映射很小”一节下找到了一个例子.

The above diagram AAgBC once processed further would return 0,32,16,1 – the 32 being the continuation bit that helps build the following value of 16. B purely decoded in Base64 is 1. So the important values that are used are 0,1. This then lets us kNow that line 1 (lines are kept count by the semi colons) column 0 of the generated file maps to file 0 (array of files 0 is foo.js),line 16 at column 1.

原文地址:https://www.jb51.cc/css/215738.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。