diff --git a/examples/react-ts/.env b/examples/react-ts/.env new file mode 100644 index 000000000000..1566bb1d76a7 --- /dev/null +++ b/examples/react-ts/.env @@ -0,0 +1 @@ +FOO=bar \ No newline at end of file diff --git a/examples/react-ts/src/button.stories.tsx b/examples/react-ts/src/button.stories.tsx index b37bb8072345..db360ee35e09 100644 --- a/examples/react-ts/src/button.stories.tsx +++ b/examples/react-ts/src/button.stories.tsx @@ -27,6 +27,13 @@ export const StoryNoRender = { args: { label: 'magic!' }, }; +export const ProcessEnv = { + args: { label: process.env.FOO }, + play: () => { + process.env.BAZ = 'moo'; + }, +}; + export const StoryWithPlay = { args: { label: 'play' }, play: () => { diff --git a/lib/core-common/src/utils/envs.ts b/lib/core-common/src/utils/envs.ts index c5287b68de79..3ed12164f269 100644 --- a/lib/core-common/src/utils/envs.ts +++ b/lib/core-common/src/utils/envs.ts @@ -59,8 +59,12 @@ export const stringifyProcessEnvs = (raw: Record): Record