UNPKG

677 BMarkdownView Raw
1# babel-plugin-transform-es2015-template-literals
2
3Compile ES2015 template literals to ES5
4
5## Installation
6
7```sh
8$ npm install babel-plugin-transform-es2015-template-literals
9```
10
11## Usage
12
13### Via `.babelrc` (Recommended)
14
15**.babelrc**
16
17```js
18// without options
19{
20 "plugins": ["transform-es2015-template-literals"]
21}
22
23// with options
24{
25 "plugins": [
26 ["transform-es2015-template-literals", {
27 "loose": true,
28 "spec": true
29 }]
30 ]
31}
32```
33
34### Via CLI
35
36```sh
37$ babel --plugins transform-es2015-template-literals script.js
38```
39
40### Via Node API
41
42```javascript
43require("babel-core").transform("code", {
44 plugins: ["transform-es2015-template-literals"]
45});
46```