diff --git a/docs/capabilities.md b/docs/capabilities.md index 33d60d5..79cd55a 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -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'; diff --git a/docs/index.md b/docs/index.md index 44453ae..46bf803 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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.