shlogg · Early preview
Ramu Narasinga @karthik-m22

Software Engineering: Property Mangling In Preact And Microbundle

Preact's mangle.json enables property mangling, compressing property names to reduce size. Configured in package.json or a separate file, it uses Terser and regular expressions to shorten property names.

I found a file named mangle.json in Preact source code. I wanted to learn more about what this file is about. In this article, we review

developit/microbundle/wiki/mangle.json
preactjs/preact/main/mangle.json


  
  
  developit/microbundle/wiki/mangle.json

In this developit/microbundle/wiki/mangle.json, you will find the mangle.json definition. 

It’s standard practice for minifiers to compress function and variable names, since doing so is mostly assumed to be transparent to the developer. Microbundle makes it easy to extend this approach to property names as well, which can have a large i...