This post aims to give a rough idea on the increase of file size after applying babel transforms to ES6 JavaScript. These figures depend highly on your style of writing code since each extra space leads to an additional byte. However, the transform comparisons will give you an idea on how they are treated by babel and how much of additional code will be injected in your file.
These file sizes are non-uglify, non-gzipped and without any method of compression on OSX.
let - var
- 3 bytes for the first rename.
- 4 bytes for each subsequent rename.
const - var
- Save 1 byte per declaration.
Class Tranforms
- 852 bytes for using simple class declaration with a constructor. Adds two new functions, namely, _createClass and _classCallCheck.
- 2114 bytes for creating and extending a class.
- Extending a class adds two more functions let us have a look at them, namely,
_get and _inherits.
Comments
Post a Comment