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

Support custom react-scripts packages #4681

Closed
mrmckeb opened this issue Nov 1, 2018 · 5 comments
Closed

Support custom react-scripts packages #4681

mrmckeb opened this issue Nov 1, 2018 · 5 comments

Comments

@mrmckeb
Copy link
Member

mrmckeb commented Nov 1, 2018

Is your feature request related to a problem? Please describe.
CRA supports the flag --scripts-version (it's not well documented), which they then use to set up CRA.

I can see that storybook is hardcoded to react-scripts. Unfortunately, packages installed with --scripts-version can have a different name than react-scripts, which means storybook no longer loads this config.

Describe the solution you'd like
I propose that we allow users to set the name of the react-scripts package, or try to infer from the react-scripts symlink in .bin.

Describe alternatives you've considered
I can rename my package to react-scripts as a workaround, but this can be confusing for users, and others will come across this issue in future.

Are you able to assist bring the feature to reality?
Yes, I am happy to. I'm not sure which path to go down:

  • Flag during startup
  • Environment variable
  • Try to understand the symlink path for react-scripts (in .bin)
@igor-dv
Copy link
Member

igor-dv commented Nov 3, 2018

Flag during startup

IMO it's not an ultimate solution

Environment variable

Sounds better to me.

@chadfawcett what do you think ?

@chadfawcett
Copy link
Member

I think I'd prefer an environment variable over a flag, but I like the idea of referencing the symlink.

@mrmckeb Do you know if the /.bin/react-scripts path stays the same? Or does it also get renamed to /.bin/react-custom-scripts? I haven't used this feature myself, and couldn't get a clear answer from the issue discussions or docs.

@mrmckeb
Copy link
Member Author

mrmckeb commented Nov 4, 2018

@igor-dv @chadfawcett Thanks for your time. I'll create a quick PR now with the symlink solution and we can discuss.

It's definitely /.bin/react-scripts which is helpful. CRA leaves the scripts the same in package.json too, so it still looks like standard CRA (such as react-scripts build).

@mrmckeb
Copy link
Member Author

mrmckeb commented Nov 4, 2018

We can move the conversation to #4712 if you would like. I've created an example there, resolving the path of the react-scripts package in use from /.bin/react-scripts.

@chadfawcett
Copy link
Member

Resolved by #4712

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

No branches or pull requests

3 participants