mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 20:30:04 +02:00
add some packages
This commit is contained in:
49
node_modules/babel-plugin-minify-guarded-expressions/README.md
generated
vendored
Normal file
49
node_modules/babel-plugin-minify-guarded-expressions/README.md
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# babel-plugin-minify-guarded-expressions
|
||||
|
||||
## Example
|
||||
|
||||
**In**
|
||||
|
||||
```javascript
|
||||
!x && foo();
|
||||
alert(0 && new Foo());
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```javascript
|
||||
x || foo();
|
||||
alert(0);
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install babel-plugin-minify-guarded-expressions
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["minify-guarded-expressions"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins minify-guarded-expressions script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["minify-guarded-expressions"]
|
||||
});
|
||||
```
|
Reference in New Issue
Block a user