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

Vite: Support environment variables in viteFinal define config #19905

Merged
merged 6 commits into from
Nov 25, 2022
Merged
Changes from 1 commit
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
Next Next commit
Vite: Do not magically support env var destructuring
IanVS committed Nov 21, 2022
commit 1d94f8cd192884d91689f0dcd286dc3d77a6b264
5 changes: 0 additions & 5 deletions code/lib/builder-vite/src/envs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { stringifyEnvs } from '@storybook/core-common';

import type { UserConfig } from 'vite';
import type { Builder_EnvsRaw } from '@storybook/types';

@@ -39,9 +37,6 @@ export function stringifyProcessEnvs(raw: Builder_EnvsRaw, envPrefix: UserConfig
'process.env.XSTORYBOOK_EXAMPLE_APP': '""',
}
);
// support destructuring like
// const { foo } = import.meta.env;
envs['import.meta.env'] = JSON.stringify(stringifyEnvs(updatedRaw));

return envs;
}