Skip to content

dotenv-expand breaking build when "$" is used #3961

Closed
@jdcrensh

Description

@jdcrensh

We use variables that include $ within the strings, which we don't want to be expanded. Escaping with \$ works fine when it occurs at the start of the string, but not anywhere else within the string.

Example:

REACT_APP_MYVAR=\$bar.baz <- works as expected, value is "$bar.baz"
REACT_APP_MYVAR=foo\$bar.baz <- I'd expect "foo$bar.baz" but I get "foo\.baz"

I also tried working around the problem, like so:

BAR=\$bar
REACT_APP_MYVAR=foo$BAR.baz

But it gave the same result of "foo\.baz"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions