24 Dec The following example is a small variation through the V3 spec instance.
Above you can view that the supply map is definitely an object containing that is literal of juicy information:
- Variation quantity that the foundation map is dependent off
- The file title of this generated rule (Your minifed/combined manufacturing file)
- sourceRoot lets you prepend the sources having a folder structure – this can be additionally an area preserving method
- sources contains all of the file names that have been combined
- names contains all variable/method names that appear through your rule.
- Finally the mappings home is when the miracle occurs Base64 that is using VLQ. The genuine area preserving is completed right right here.
Base64 VLQ and maintaining the supply map little
Initially the foundation map spec had a really verbose production of all mappings and led to the sourcemap being about 10 times how big is the code that is generated. Variation two paid down that by around 50 version and% three paid down it once more by another 50%, therefore for the 133kB file you get having a
300kB supply map. So just how did they reduce steadily the size while nevertheless keeping the mappings that are complex?
VLQ (Variable size amount) can be used along side encoding the value in to a Base64 value. The mappings home is an excellent big sequence. Inside this sequence are semicolons (;) that represent a line quantity in the generated file. Within each line you can find commas (,) that represent each part within that line. Every one of these segments is either 1, four or five in variable size industries. Some may seem much much longer but these have continuation bits.