Skip to content

constant-folding template strings #612

@mariusGundersen

Description

@mariusGundersen

There is a bug in the babel-plugin-minify-constant-folding package where it incorrectly inlines template strings. Here is a simple example:

const a = ["a", "b"].join(' ');
// -> const a="a b";


const b = [`a${a}`, `b${a}`].join(' ');
// -> const b=" ";

In the second example it should keep the interpolation and produce a template string, but it does not, instead returning just an empty string. The result is broken code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bughas PRHas an open PR that fixes this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions