Switch branches/tags
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
__tests__
src
.npmignore
README.md
package.json

README.md

babel-plugin-minify-builtins

Minify Standard built-in Objects

Example

In

Math.floor(a) + Math.floor(b)

Out

var _Mathfloor = Math.floor;

_Mathfloor(a) + _Mathfloor(b);

Installation

npm install babel-plugin-minify-builtins --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["minify-builtins"]
}

Via CLI

babel --plugins minify-builtins script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["minify-builtins"]
});

Options

  • tdz - Account for TDZ (Temporal Dead Zone)