question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use with Storybook

See original GitHub issue

Hello,

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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
patricklafrancecommented, Aug 13, 2019

I know it’s been a while but it should work now with the new API.

Documentation available here.

0reactions
danielknellcommented, Nov 25, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found