@babel/plugin-transform-template-literals
In
Out
npm install --save-dev @babel/plugin-transform-template-literals
Without options:
{
"plugins": [
[
"@babel/plugin-transform-template-literals",
{
"loose": true
}
]
}
babel --plugins @babel/plugin-transform-template-literals script.js
boolean
, defaults to false
.
// babel.config.json
{
"assumptions": {
"mutableTemplateObject": true
When mutableTemplateObject
is 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
.
In
`foo${bar}`;
Out