question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Referencing an ENV variable in the Capacitor config file

See original GitHub issue

Hi there,

I have the following in my capacitor.config.json file:

{
  ...
  "server": {
    "url": "http://localhost:8080"
  }
}

I’d like to be able to set that value in an .env file:

VUE_APP_SERVER_URL=http://localhost:8080

However, I can’t reference process.env.VUE_APP_SERVER_URL in the JSON file, for obvious reasons. Is there an environment variable name that I can use to set that value, so I can exclude the server object from my config altogether?

Thank you!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
ionitron-bot[bot]commented, Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment Specific Configurations | Capacitor Documentation
The Capacitor configuration file handles high-level options for Capacitor tooling ... To demonstrate differences between each environment, the app name and ...
Read more >
Maintain a Global Configuration File - Ionic Framework
Set and print configuration values from project config files and the global CLI config file with Ionic CLI. Read to learn more about...
Read more >
CAPACITOR_ANDROID_STUDI...
Attempted to open Android Studio at: You can configure this with the CAPACITOR_ANDROID_STUDIO_PATH environment variable. I referenced it from ...
Read more >
Environment Variables in Angular / Ionic | by Adnane Lamghari
Create environment.preprod.ts file in src/environment folder; In your angular.json file add the following lines (edit the config if you want) :.
Read more >
Configure Kapacitor - InfluxData Documentation
The path to the configuration file can also be declared using the environment variable KAPACITOR_CONFIG_PATH . Values declared in the configuration file are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found