Use with Storybook
See original GitHub issueHello,
according to Storybook, it’s possible to use our own webpack.config.js (https://storybook.js.org/configurations/custom-webpack-config/#using-your-existing-config) to configure Storybook as well.
How would you wire Storybook and craco to use the same configuration?
The most simple would be to provide the function which computes the craco config into the webpack config?
Something like :
// .storybook/webpack.config.js
const { craco } = require('@craco/craco')
module.exports = craco(require('../craco.config.js'))
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Storybook Tutorials
Learn how to develop UIs with components and design systems. Our in-depth frontend guides are created by Storybook maintainers and peer-reviewed by the...
Read more >Build a simple component - Storybook Tutorials
Learn how to develop UIs with components and design systems. Our in-depth frontend guides are created by Storybook maintainers and peer-reviewed by the...
Read more >Storybook for React tutorial
Storybook runs alongside your app in development mode. It helps you build UI components isolated from the business logic and context of your...
Read more >Introduction to Storybook for React
Storybook is a tool for UI development. It makes development faster and easier by isolating components. This allows you to work on one...
Read more >Storybook: Frontend workshop for UI development
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know it’s been a while but it should work now with the new API.
Documentation available here.
I hit problems with Craco and storybook last night so built an experimental preset based on preset-create-react-app to use the webpack config from Craco instead of pulling it directly from react-scripts.
This means any Craco plugins, changes postcss plugins, manual webpack tweaks, etc will also be applied to storybook.
Its a bit hackey at the moment and calls out to internal apis inside preset-create-react-app but that seemed like a better choice than re-inventing the wheel.
Any feedback, contributions, fixes, etc are welcome, it would be good to have solid integration between storybook and Craco.