1 |
3a515b92
|
cagy
|
# babel-plugin-transform-es2015-sticky-regex
|
2 |
|
|
|
3 |
|
|
> Compile ES2015 sticky regex to an ES5 RegExp constructor
|
4 |
|
|
|
5 |
|
|
## Installation
|
6 |
|
|
|
7 |
|
|
```sh
|
8 |
|
|
npm install --save-dev babel-plugin-transform-es2015-sticky-regex
|
9 |
|
|
```
|
10 |
|
|
|
11 |
|
|
## Usage
|
12 |
|
|
|
13 |
|
|
### Via `.babelrc` (Recommended)
|
14 |
|
|
|
15 |
|
|
**.babelrc**
|
16 |
|
|
|
17 |
|
|
```json
|
18 |
|
|
{
|
19 |
|
|
"plugins": ["transform-es2015-sticky-regex"]
|
20 |
|
|
}
|
21 |
|
|
```
|
22 |
|
|
|
23 |
|
|
### Via CLI
|
24 |
|
|
|
25 |
|
|
```sh
|
26 |
|
|
babel --plugins transform-es2015-sticky-regex script.js
|
27 |
|
|
```
|
28 |
|
|
|
29 |
|
|
### Via Node API
|
30 |
|
|
|
31 |
|
|
```javascript
|
32 |
|
|
require("babel-core").transform("code", {
|
33 |
|
|
plugins: ["transform-es2015-sticky-regex"]
|
34 |
|
|
});
|
35 |
|
|
```
|