Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Mock react-scripts 'config' folder #593

Merged
merged 8 commits into from
Feb 14, 2022

Conversation

bencergazda
Copy link
Contributor

@bencergazda bencergazda commented Jan 4, 2022

react-scripts has a config folder that contains the base webpack or devServer configuration. Some 3rd party packages (like @storybook/preset-create-react-app) require these files, serving as a base for their own configuration.

This PR:

  • removes the rewiring-related duplicated code fragments and move them to separate files
  • adds the folder config/webpack.config.js, config/webpackDevServer.config.js and config/paths.config.js files that export the rewired configuration EVEN if we didn't call the react-app-rewired command.

This makes storybook (and probably many other packages) plug and play also for the rewired apps.

@timarney
Copy link
Owner

timarney commented Jan 6, 2022

Thanks @bencergazda --- I think I'll spin up a "next" release for this for testing prior to a real release.

@dawnmist outside of ensuring this is backwards compatible any other thoughts?

@timarney
Copy link
Owner

timarney commented Jan 26, 2022

Just published under "next tag" if anyone can test & confirm.

Screen Shot 2022-01-26 at 5 43 13 AM

@timarney
Copy link
Owner

Some 3rd party packages (like @storybook/preset-create-react-app) require these files, serving as a base for their own configuration.

marged.

@bencergazda does this feel like a feature release to you or a patch

@bencergazda
Copy link
Contributor Author

@timarney I'd rather say this is a feature!

@timarney
Copy link
Owner

Published 2.2.0

Thanks for the PRs

@bencergazda
Copy link
Contributor Author

bencergazda commented Feb 15, 2022

@timarney Sorry, but after the first install, I realized that we need to add /config to the files array in package.json. Otherwise npm publish strips that folder from the package. This problem didn't show up while installing the git repo. 😞

This doesn't affect the core functionality, but the mocked config folder won't be accessible until we fix this. Submitted #606 with the correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants