babel / babel/minify

Inline constant template literal interpolations

Open
#709 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

#### Input Code

```js
const a = `foo ${'bar'} baz`;
const b = `foo ${true ? 'bar' : 'qux'} baz`;
```

#### Actual Output

```js
const a=`foo ${'bar'} baz`,b=`foo ${'bar'} baz`;
```

#### Expected Output

```js
const a=`foo bar baz`,b=`foo bar baz`;
```

#### Details

I believe this should be safe to do as long as the template literal is not tagged.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.