Skip to content

Commit

Permalink
chore: 🔧 (web) StorybookのexperimentalRSC機能を有効化した。 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReoHakase committed May 25, 2024
1 parent 8b0b42e commit 5bd96d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/web/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import path from 'path';
import type { Configuration } from 'webpack';

const config: StorybookConfig = {
env: (config) => ({ ...config, IS_STORYBOOK: 'true' }),
addons: ['@storybook/addon-a11y', '@storybook/addon-essentials', '@storybook/addon-interactions'],
framework: {
name: '@storybook/nextjs',
options: {},
},
features: {
experimentalRSC: true,
},
staticDirs: ['../public'],
stories: ['../src/**/*.story.tsx', '../src/**/*.stories.tsx'],
webpackFinal: (config) => {
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { z } from 'zod';
* @default typeof window === "undefined"
* @see https://github.com/t3-oss/t3-env/blob/main/packages/core/src/index.ts
*/
const isServer = typeof window === 'undefined' || process.env.NODE_ENV === 'test';
const isServer =
typeof window === 'undefined' || process.env.NODE_ENV === 'test' || process.env.IS_STORYBOOK === 'true';

export const env = createEnv({
isServer,
Expand Down

0 comments on commit 5bd96d6

Please sign in to comment.