es6.spec.templateLiterals

How to use the es6.spec.templateLiterals transformer.

This transformer wraps all template literal expressions with String. See Issue #1065 for more info.

Usage

require("babel").transform("code", { optional: ["es6.spec.templateLiterals"] });
$ babel --optional es6.spec.templateLiterals script.js

Example

In

`foo${bar}`;

Out

"foo" + String(bar);