Environment vars changes

This commit is contained in:
jonniebigodes 2023-01-19 17:38:42 +00:00
parent 4e68732915
commit 9476e28433
3 changed files with 27 additions and 1 deletions

View File

@ -83,6 +83,7 @@ Additionally, you can extend your Storybook configuration file (i.e., [`.storybo
<CodeSnippets
paths={[
'common/storybook-main-env-field-config.js.mdx',
'common/storybook-main-env-field-config.ts.mdx',
]}
/>

View File

@ -2,7 +2,7 @@
// .storybook/main.js
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',

View File

@ -0,0 +1,25 @@
```ts
// .storybook/main.ts
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-webpack5)
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
/*
* 👇 The `config` argument contains all the other existing environment variables.
* Either configured in an `.env` file or configured on the command line.
*/
env: (config) => ({
...config,
EXAMPLE_VAR: 'An environment variable configured in Storybook',
}),
};
export default config;
```