Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ env.MY_KEY
const { MY_KEY } = env
const { MY_KEY: alias, OTHER_KEY = "fallback" } = env

// SvelteKit – dynamic (any alias name works)
import { env as anyName } from '$env/dynamic/private';
import { env as anyName } from '$env/dynamic/public';
anyName.MY_KEY
const { MY_KEY } = anyName

// Multiple aliased imports in the same file are also supported:
import { env as publicEnv } from '$env/dynamic/public';
import { env as privateEnv } from '$env/dynamic/private';
publicEnv.PUBLIC_API_URL
privateEnv.SECRET_KEY

// SvelteKit – static (named imports)
import { MY_KEY } from '$env/static/private';
import { MY_KEY } from '$env/static/public';
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Welcome to the official documentation for `vscode-dotenv-diff`, a VS Code extens

## What is vscode-dotenv-diff?

When building applications, it's easy to reference `process.env.MY_KEY` in your code but forget to define it in your `.env` file — or to leave stale keys in `.env` that are no longer used anywhere. Both problems are silent and hard to spot.
When building applications, it's easy to reference `process.env.MY_KEY` (Node.js), `import.meta.env.MY_KEY` (Vite), or `import { MY_KEY } from '$env/static/private'` (SvelteKit) in your code but forget to define it in your `.env` file — or to leave stale keys in `.env` that are no longer used anywhere. Both problems are silent and hard to spot.

`vscode-dotenv-diff` solves this by analysing your source files and surfacing warnings exactly where the problem is, without any configuration.

Expand Down