# install storybook dependencies
yarn add @storybook/addon-actions @storybook/addon-essentials @storybook/react -D
yarn add @storybook/addon-postcss@latest -D
# install webpack5 dependency
yarn add @storybook/builder-webpack5@next -D
# install scss dependencies
yarn add css-loader sass-loader style-loader postcss-loader -D
Either you copy and paste the files below into your repository or execute the following commands and then adjust the files:
# setup fresh storybook installation with webpack@5
npx sb@next init --builder webpack5
# update storybook version (required to fix [email protected] issues)
# as of 2021-03-16
npx sb@next upgrade --prerelease
{
"devDependencies": {
"@babel/core": "^7.13.10",
"@storybook/addon-actions": "^6.2.0-rc.1",
"@storybook/addon-essentials": "^6.2.0-rc.1",
"@storybook/addon-links": "^6.2.0-rc.1",
"@storybook/addon-postcss": "2.0.0",
"@storybook/builder-webpack5": "6.2.0-rc.1",
"@storybook/react": "^6.2.0-rc.1",
"babel-loader": "^8.2.2",
"css-loader": "5.1.3",
"postcss-loader": "5.2.0",
"sass-loader": "11.0.1",
"style-loader": "2.0.0",
"tailwindcss": "2.0.3"
}
}
- Storybook for Webpack 5
- Instructions for testing Storybook Webpack 5 support
- Storybook doesn't work with the newest version 10.0.1 of PostCSS Autoprefixer plugin · Issue #12668 · storybookjs/storybook
- Configure NextJS with Storybook and TailwindCSS
- Cant add aliases in storybook config · Issue #11989 · storybookjs/storybook