Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are env values expected to be settable via configuration? #417

Closed
akauppi opened this issue Jun 19, 2020 · 0 comments
Closed

Are env values expected to be settable via configuration? #417

akauppi opened this issue Jun 19, 2020 · 0 comments

Comments

@akauppi
Copy link
Contributor

akauppi commented Jun 19, 2020

Describe the bug

The README says:

For now, see config.ts for full details before more thorough documentation is available.

This line lead me to think that environment values can be set also in the configuration, but this did not work:

vite.emul.config.js:

module.exports = {
  env: {
    DEV_FUNCTIONS_URL: "http://localhost:5001",
    DEV_FIRESTORE_HOST: "localhost:8080"
  }
}

I need to pass these values (or at least a boolean) from the command line into the browser. Both variants are "dev" so the modes system is a bit wrong tool for it. Would appreciate it if the above config is expected to work - at some point. If not, there could be a mention in the source code about it.

Placing env. values as an .env.$mode file does work. But it clutters the root level folder so I'd favour configuration files instead.

Reproduction

https://github.com/akauppi/GroundLevel-es6-firebase-web

The repo keeps moving though.

System Info

  • required vite version: 0.20.10
  • required Operating System: macOS 10.15.5
  • required Node version: 14
  • Optional:
    • npm/yarn version
    • Installed vue version (from yarn.lock or package-lock.json)
    • Installed @vue/compiler-sfc version

Logs (Optional if provided reproduction)

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant