Back to Storybook

React Webpack5 Add Framework

docs/_snippets/react-webpack5-add-framework.md

10.3.61.2 KB
Original Source
js
export default {
  // ...
  framework: '@storybook/react-webpack5', // ๐Ÿ‘ˆ Add this
};
ts
import type { StorybookConfig } from '@storybook/react-webpack5';

const config: StorybookConfig = {
  // ...
  framework: '@storybook/react-webpack5', // ๐Ÿ‘ˆ Add this
};

export default config;
ts
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { defineMain } from '@storybook/your-framework/node';

export default defineMain({
  // ...
  framework: '@storybook/react-webpack5', // ๐Ÿ‘ˆ Add this
});
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { defineMain } from '@storybook/your-framework/node';

export default defineMain({
  // ...
  framework: '@storybook/react-webpack5', // ๐Ÿ‘ˆ Add this
});