CRA: Move cra-config into a separate preset
See original GitHub issueCurrently CRA config is a magic step that happens during @storybook/react
loading. It should be split out into its own preset so that it is more transparent and easier to reason about.
For example in https://github.com/storybookjs/presets/issues/20, CRA is silently removing the docgen information added by preset-typescript
.
There are also other cases, e.g. supporting custom forks of CRA, where we want to give users more control: https://github.com/storybookjs/storybook/issues/6973
It would be great to:
- Move CRA-config into its own preset
- Auto-detect react-scripts in the CLI and add that preset automatically
- Provide a clean migration path for existing CRA apps (a warning if preset is not defined + instructions in
MIGRATION.md
?)
In addition (probably a separate issue?) preset-cra
should log when it’s removing rules using #7220.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (12 by maintainers)
Top Results From Across the Web
Storybook with craco - call a different verson of react-scripts
I've successfully used storybook-preset-craco with @storybook@6.3.5 and react-scripts@4.0.3 and @craco/craco@6.2.0 in a new CRA TypeScript ...
Read more >Keeping up with Create React App (after ejecting) - Medium
First, we created a new CRA project using npx create-react-app projectName (it's better to do this in a separate directory). Step 2. Immediately ......
Read more >Keeping up with Create React App (after ejecting) - LinkedIn
At Breathe Life, we love Create React App (CRA). It has allowed us to get new projects started in minutes, rather than days....
Read more >A guide on switching a CRA project to Vite? : r/reactjs - Reddit
I think they are worried about using two different tools for dev and prod which introduces an inconsistency, which isn't ideal. But this...
Read more >Codebase Conversion: Building a MEAN.js AngularJS Project ...
How I hacked CRA's config to have it build a classic AngularJS codebase ... by default and render a React component tree in...
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
Ah, OK - yes… will take a look today.
Hey @mrmckeb I think this would be a big milestone towards getting presets adopted. We’re in the thick of the 5.2 release, so we probably wouldn’t get it in until 5.3, but if you wanted to take a stab at it, it would be much appreciated!! 🙇