mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-20 23:05:09 +00:00
49 lines
578 B
Markdown
49 lines
578 B
Markdown
# babel-plugin-minify-mangle-names
|
|
|
|
Shortening of numeric literals via scientific notation
|
|
|
|
## Example
|
|
|
|
**In**
|
|
|
|
```javascript
|
|
[1000, -20000]
|
|
```
|
|
|
|
**Out**
|
|
|
|
```javascript
|
|
[1e3, -2e4]
|
|
```
|
|
|
|
## Installation
|
|
|
|
```sh
|
|
$ npm install babel-plugin-minify-numeric-literals
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Via `.babelrc` (Recommended)
|
|
|
|
**.babelrc**
|
|
|
|
```json
|
|
{
|
|
"plugins": ["minify-numeric-literals"]
|
|
}
|
|
```
|
|
|
|
### Via CLI
|
|
|
|
```sh
|
|
$ babel --plugins minify-numeric-literals script.js
|
|
```
|
|
|
|
### Via Node API
|
|
|
|
```javascript
|
|
require("babel-core").transform("code", {
|
|
plugins: ["minify-numeric-literals"]
|
|
});
|
|
```
|