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.

CRA: Move cra-config into a separate preset

See original GitHub issue

Currently 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:closed
  • Created 4 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mrmckebcommented, Oct 14, 2019

Ah, OK - yes… will take a look today.

1reaction
shilmancommented, Jul 22, 2019

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!! 🙇

Read more comments on GitHub >

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

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