Skip to content

.env variables are being expanded when I don't want them to be #3596

@daviesdoclc

Description

@daviesdoclc

Version

3.5.0

Environment info

Sorry... I don't run vue globally.  It's just part of my project.  So not sure how to get this.

Steps to reproduce

I have some urls inside my .env file like this

VUE_APP_GEOCODE_URL=https://maps.googleapis.com/maps/api/geocode/json?address=${address}&components=country:${country}&key=${key}

I use to be able to access this in my javascript as

process.env.VUE_APP_GEOCODE_URL and do parameter substitution with es6-dynamic-template (https://www.npmjs.com/package/es6-dynamic-template)

However, the latest version of vue-cli seems to have changed this, and is expanding the url for me (with non-existent variables). I noticed this commit #3534 that is using https://github.com/motdotla/dotenv-expand. I suspect this is causing my issues. How do we prevent it from processing our variables or how can I escape it so I control the substitution?

What is expected?

Previous versions did not expand the environment variables.

What is actually happening?

My environment variables are being expanded. I use to do the substitution myself at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions