mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-20 23:05:09 +00:00
51 lines
580 B
Markdown
51 lines
580 B
Markdown
# babel-plugin-minify-builtins
|
|
|
|
Minify Standard built-in Objects
|
|
|
|
## Example
|
|
|
|
**In**
|
|
|
|
```javascript
|
|
Math.floor(a) + Math.floor(b)
|
|
```
|
|
|
|
**Out**
|
|
|
|
```javascript
|
|
var _Mathfloor = Math.floor;
|
|
|
|
_Mathfloor(a) + _Mathfloor(b);
|
|
```
|
|
|
|
## Installation
|
|
|
|
```sh
|
|
npm install babel-plugin-minify-builtins
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Via `.babelrc` (Recommended)
|
|
|
|
**.babelrc**
|
|
|
|
```json
|
|
{
|
|
"plugins": ["minify-builtins"]
|
|
}
|
|
```
|
|
|
|
### Via CLI
|
|
|
|
```sh
|
|
babel --plugins minify-builtins script.js
|
|
```
|
|
|
|
### Via Node API
|
|
|
|
```javascript
|
|
require("babel-core").transform("code", {
|
|
plugins: ["minify-builtins"]
|
|
});
|
|
```
|