Above you can observe that the supply map can be an object literal containing lots of juicy information:
- Variation quantity that the origin map is dependent off
- The file name for the code that is generatedYour minifed/combined manufacturing file)
- sourceRoot lets you prepend the sources having a folder structure – this might be additionally a place preserving strategy
- sources contains all of the file names which were combined
- names contains all variable/method names that appear through your code.
- Finally the mappings home is where the miracle occurs utilizing Base64 VLQ values. The real area preserving is completed here.
Base64 VLQ and maintaining the supply map tiny
Originally the origin map spec had a tremendously verbose production of the many mappings and triggered the sourcemap being about 10 times how big the generated rule. Variation two paid down that by around 50% and variation three paid off it once more by another 50%, therefore for a 133kB file you wind up by having a
300kB supply map. Just how did they lower the size while nevertheless keeping the mappings that are complex?
VLQ (Variable size volume) can be used along side encoding the worthiness into a Base64 value. The mappings home is a brilliant string that is big. Through this sequence are semicolons (;) that represent a line quantity within the generated file. Within each relative line you will find commas (,) that represent each part within that line. Each one of these segments is either 1, four or five in adjustable length areas. Some may seem longer but these have continuation bits. Each portion develops upon the prior, which assists reduce steadily the quality as each bit is in accordance with its segments that are previous. Read More