Bug Report
Current Behavior
t.templateLiteral({raw}, tail) does not contain a cooked value.
Input Code
cfware/babel-plugin-template-html-minifier@aa91d8c
My babel plugin uses the raw value of quasi elements. Babel does not provide any helper to convert between raw and cooked values for templateElement. Per cfware/babel-plugin-template-html-minifier#10 lack of cooked creates a problem when transpiling for IE11 (I will post an update if I get a minimal reproduction repo).
Expected behavior/code
A way to create a templateElement when only cooked or raw is known should be possible.
Babel Configuration (.babelrc, package.json, cli command)
I don't have the specific babelrc, I will provide once I get an update from the reporter of the bug on my plugin.
Environment
- Babel version(s): ^7.0.0
- Node/npm version: node 10.14.2, npm 6.4.1
- OS: Fedora 28
- Monorepo: no
- How you are using Babel: webpack
Possible Solution
t.templateElement could automatically populate cooked from raw, or raw from cooked if only one option is provided. Alternatively a helper function to convert between raw and cooked would be helpful.
Bug Report
Current Behavior
t.templateLiteral({raw}, tail)does not contain acookedvalue.Input Code
cfware/babel-plugin-template-html-minifier@aa91d8c
My babel plugin uses the
rawvalue of quasi elements. Babel does not provide any helper to convert betweenrawandcookedvalues for templateElement. Per cfware/babel-plugin-template-html-minifier#10 lack ofcookedcreates a problem when transpiling for IE11 (I will post an update if I get a minimal reproduction repo).Expected behavior/code
A way to create a templateElement when only
cookedorrawis known should be possible.Babel Configuration (.babelrc, package.json, cli command)
I don't have the specific babelrc, I will provide once I get an update from the reporter of the bug on my plugin.
Environment
Possible Solution
t.templateElementcould automatically populatecookedfromraw, orrawfromcookedif only one option is provided. Alternatively a helper function to convert betweenrawandcookedwould be helpful.