@babel/plugin-transform-template-literals
Advanced tools
Comparing version 7.0.0-beta.49 to 7.0.0-beta.50
{ | ||
"name": "@babel/plugin-transform-template-literals", | ||
"version": "7.0.0-beta.49", | ||
"version": "7.0.0-beta.50", | ||
"description": "Compile ES2015 template literals to ES5", | ||
@@ -9,4 +9,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals", | ||
"dependencies": { | ||
"@babel/helper-annotate-as-pure": "7.0.0-beta.49", | ||
"@babel/helper-plugin-utils": "7.0.0-beta.49" | ||
"@babel/helper-annotate-as-pure": "7.0.0-beta.50", | ||
"@babel/helper-plugin-utils": "7.0.0-beta.50" | ||
}, | ||
@@ -20,5 +20,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.49", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.49" | ||
"@babel/core": "7.0.0-beta.50", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.50" | ||
} | ||
} |
@@ -5,82 +5,16 @@ # @babel/plugin-transform-template-literals | ||
## Example | ||
See our website [@babel/plugin-transform-template-literals](https://new.babeljs.io/docs/en/next/babel-plugin-transform-template-literals.html) for more information. | ||
**In** | ||
## Install | ||
```javascript | ||
`foo${bar}`; | ||
``` | ||
Using npm: | ||
**Out** | ||
```javascript | ||
"foo".concat(bar); | ||
``` | ||
## Installation | ||
```sh | ||
npm install --save-dev @babel/plugin-transform-template-literals | ||
npm install --save @babel/plugin-transform-template-literals | ||
``` | ||
## Usage | ||
or using yarn: | ||
### Via `.babelrc` (Recommended) | ||
**.babelrc** | ||
Without options: | ||
```json | ||
{ | ||
"plugins": ["@babel/plugin-transform-template-literals"] | ||
} | ||
``` | ||
With options: | ||
```json | ||
{ | ||
"plugins": [ | ||
["@babel/plugin-transform-template-literals", { | ||
"loose": true | ||
}] | ||
] | ||
} | ||
``` | ||
### Via CLI | ||
```sh | ||
babel --plugins @babel/plugin-transform-template-literals script.js | ||
yarn add --save @babel/plugin-transform-template-literals | ||
``` | ||
### Via Node API | ||
```javascript | ||
require("@babel/core").transform("code", { | ||
plugins: ["@babel/plugin-transform-template-literals"] | ||
}); | ||
``` | ||
## Options | ||
### `loose` | ||
`boolean`, defaults to `false`. | ||
When `true`, tagged template literal objects aren't frozen. All template literal expressions and quasis are combined with the `+` operator instead of with `String.prototype.concat`. | ||
When `false` or not set, all template literal expressions and quasis are combined with `String.prototype.concat`. It will handle cases with `Symbol.toPrimitive` correctly and throw correctly if template literal expression is a `Symbol()`. See [babel/babel#5791](https://github.com/babel/babel/pull/5791). | ||
**In** | ||
```javascript | ||
`foo${bar}`; | ||
``` | ||
**Out** | ||
```javascript | ||
"foo" + bar; | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5015
3
20
+ Added@babel/helper-annotate-as-pure@7.0.0-beta.50(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.50(transitive)
- Removed@babel/helper-annotate-as-pure@7.0.0-beta.49(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.49(transitive)