Salesforce DotEnv VS Code Extension
This extension loads environment variables from .env files for Salesforce development.
Features
- Loads environment variables from
.env files for Salesforce extensions
- Customizable
.env file paths to match your naming conventions
- Optional auto-reload when
.env file changes (configurable)
- Integrates specifically with Salesforce VS Code extensions
- Enhanced status bar showing current
.env file and variable count
- Switch between multiple
.env files in the workspace
- Manual reload of current environment file
Usage
- Install this extension in VS Code
- Create a
.env file in your Salesforce project root
- Environment variables will be automatically loaded
- Status bar shows current
.env file and variable count
- Click status bar to reload current environment file or switch between different
.env files
Configuration
sf-dotenv.envFile: Path to the .env file to automatically load (defaults to .env)
sf-dotenv.showInfoMessages: Show info messages when environment variables are reloaded
"sf-dotenv.envFilePatterns: Configurable glob patterns to search for environment files"
How it works
The extension monitors your .env file for changes and:
- Loads environment variables into the extension host
- Updates VS Code settings for Salesforce extensions
- Updates terminal environment variables
- Enhanced status bar shows current file and variable count
- File discovery finds all
.env files in the workspace
- Quick switching between different environment files
Commands
sf-dotenv.loadEnvFile: Load environment variables from .env file
sf-dotenv.selectEnvFile: Switch to a different .env file
sf-dotenv.reloadEnvFile: Reload the current environment file
sf-dotenv.showMenu: Show the Salesforce DotEnv menu
| |