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

Document maintaining a fork of react-scripts as an alternative to ejecting #682

Closed
gaearon opened this Issue Sep 19, 2016 · 79 comments

Comments

Projects
None yet
@gaearon
Member

gaearon commented Sep 19, 2016

It is not common knowledge that you can fork react-scripts, publish your fork, and then do create-react-app my-app --scripts-version my-react-scripts-fork.

This can be useful for customized setups, especially if you want to merge upstream updates once in a while. And with something like https://github.com/1egoman/backstroke, it might not even be painful!

We should document this. Help welcome!

@thangngoc89

This comment has been minimized.

Show comment
Hide comment
@thangngoc89

thangngoc89 Sep 19, 2016

Contributor

I tried this before. (0.2 maybe). But the global cli doesn't install the custom script. Was it fix?

Contributor

thangngoc89 commented Sep 19, 2016

I tried this before. (0.2 maybe). But the global cli doesn't install the custom script. Was it fix?

@zperrault

This comment has been minimized.

Show comment
Hide comment
@zperrault

zperrault Sep 19, 2016

We are going to be forking react-scripts and attempting to move our build process over to it @trunkclub. I'll talk to the team but I think we could write documentation as we go through the process.

zperrault commented Sep 19, 2016

We are going to be forking react-scripts and attempting to move our build process over to it @trunkclub. I'll talk to the team but I think we could write documentation as we go through the process.

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 19, 2016

Member

But the global cli doesn't install the custom script. Was it fix?

There was a bug but should be fine with 0.4.3.

Member

gaearon commented Sep 19, 2016

But the global cli doesn't install the custom script. Was it fix?

There was a bug but should be fine with 0.4.3.

@leftdevel

This comment has been minimized.

Show comment
Hide comment
@leftdevel

leftdevel Sep 19, 2016

This is supper awesome (...if I understood correctly), Thank you! I'm loving create-react-app, but in the current state it felt like you either embrace it as it is (minimal), or move away. And "Eject" makes you feel like you're being ungrateful with the maintainers.

Now with this approach, and in my company, I can be the one maintaining the custom scripts while still keeping my teammates away from the struggle of battling configuration files.

For instance, I'd just add less-css support, and still benefit from the core create-react-app features and updates.

leftdevel commented Sep 19, 2016

This is supper awesome (...if I understood correctly), Thank you! I'm loving create-react-app, but in the current state it felt like you either embrace it as it is (minimal), or move away. And "Eject" makes you feel like you're being ungrateful with the maintainers.

Now with this approach, and in my company, I can be the one maintaining the custom scripts while still keeping my teammates away from the struggle of battling configuration files.

For instance, I'd just add less-css support, and still benefit from the core create-react-app features and updates.

@kirkaustin

This comment has been minimized.

Show comment
Hide comment
@kirkaustin

kirkaustin Sep 19, 2016

I just run a short custom script after create-react-app does its thing so that I can support CSSModules. All it does is alter two lines in the webpack config scripts (css loader delacarations).

Seemed like overkill to fork and publish, but maybe that's the way to go?

kirkaustin commented Sep 19, 2016

I just run a short custom script after create-react-app does its thing so that I can support CSSModules. All it does is alter two lines in the webpack config scripts (css loader delacarations).

Seemed like overkill to fork and publish, but maybe that's the way to go?

@thangngoc89

This comment has been minimized.

Show comment
Hide comment
@thangngoc89

thangngoc89 Sep 19, 2016

Contributor

@kirkaustin you don't need to publish it. You can install it directly from github

Contributor

thangngoc89 commented Sep 19, 2016

@kirkaustin you don't need to publish it. You can install it directly from github

@kirkaustin

This comment has been minimized.

Show comment
Hide comment
@kirkaustin

kirkaustin Sep 19, 2016

@thangngoc89 Not sure I understand. At my company we have an enterprise GitHub account. Are you suggesting that I can have my fork pulled from there?

kirkaustin commented Sep 19, 2016

@thangngoc89 Not sure I understand. At my company we have an enterprise GitHub account. Are you suggesting that I can have my fork pulled from there?

@thangngoc89

This comment has been minimized.

Show comment
Hide comment
@thangngoc89

thangngoc89 Sep 19, 2016

Contributor

You're using npm to install dependencies right? You can do this npm install git+ssh://git@github.com/your-company/react-scripts-fork . You don't need to publish the scripts to npm and then install it.

Contributor

thangngoc89 commented Sep 19, 2016

You're using npm to install dependencies right? You can do this npm install git+ssh://git@github.com/your-company/react-scripts-fork . You don't need to publish the scripts to npm and then install it.

@kirkaustin

This comment has been minimized.

Show comment
Hide comment
@kirkaustin

kirkaustin Sep 19, 2016

Great, thanks!

kirkaustin commented Sep 19, 2016

Great, thanks!

@dpoineau

This comment has been minimized.

Show comment
Hide comment
@dpoineau

dpoineau Sep 21, 2016

Just curious if anyone has gotten a forked version of react-scripts via direct-from-github npm install working with the most recent create-react-app repository code? @thangngoc89

With the switch by create-react-app to using lerna and as a result react-scripts moving into the packages/react-scripts subdirectory, it doesn't seem possible to install a forked react-scripts directly from github any longer (since npm cannot install from a github repo subdirectory), or am I missing something?

Previously forking the entire repo (and referencing via github url) worked because react-scripts was the package specified in the repo's root package.json, but that's no longer the case it seems.

So is publishing a custom npm package then the only way to take advantage of this approach?

dpoineau commented Sep 21, 2016

Just curious if anyone has gotten a forked version of react-scripts via direct-from-github npm install working with the most recent create-react-app repository code? @thangngoc89

With the switch by create-react-app to using lerna and as a result react-scripts moving into the packages/react-scripts subdirectory, it doesn't seem possible to install a forked react-scripts directly from github any longer (since npm cannot install from a github repo subdirectory), or am I missing something?

Previously forking the entire repo (and referencing via github url) worked because react-scripts was the package specified in the repo's root package.json, but that's no longer the case it seems.

So is publishing a custom npm package then the only way to take advantage of this approach?

@dpoineau

This comment has been minimized.

Show comment
Hide comment
@dpoineau

dpoineau Sep 22, 2016

So for now I went down the path of using a custom published npm package (like react-scripts-custom-whatever), but it still seems like there's at least one issue that prevents this from working which is that the react-scripts package name is hardcoded in at least one spot, which won't work if you're using a custom forked package: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/scripts/init.js#L17

The end result for me is that create-react-app fails at executing the init script. Has anyone been successful with this approach with the most recent version of react-scripts (0.4.3), and I'm just doing something wrong?

Edit: after looking at how e2e.sh runs its --scripts-version react-scripts-fork test successfully, it looks like the solution used in that fork was to just change the hardcoded package name in the line I referenced above in the fork to be the forked package name.

Last edit: Here are all the steps I used to get a custom fork working in case anyone else gets as stuck as I did 😃

  1. Forked the create-react-app repo and cloned it locally
  2. Changed the package name in packages/react-scripts/package.json to be a new custom name
  3. Changed the 'react-scripts' reference in packages/react-scripts/scripts/init.js#L17 to match the new package name I chose
  4. Then I did a cd packages/react-scripts followed by an npm publish which published successfully
  5. Which then resulted in create-react-app test-app --scripts-version react-scripts-my-custom-package working as expected

dpoineau commented Sep 22, 2016

So for now I went down the path of using a custom published npm package (like react-scripts-custom-whatever), but it still seems like there's at least one issue that prevents this from working which is that the react-scripts package name is hardcoded in at least one spot, which won't work if you're using a custom forked package: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/scripts/init.js#L17

The end result for me is that create-react-app fails at executing the init script. Has anyone been successful with this approach with the most recent version of react-scripts (0.4.3), and I'm just doing something wrong?

Edit: after looking at how e2e.sh runs its --scripts-version react-scripts-fork test successfully, it looks like the solution used in that fork was to just change the hardcoded package name in the line I referenced above in the fork to be the forked package name.

Last edit: Here are all the steps I used to get a custom fork working in case anyone else gets as stuck as I did 😃

  1. Forked the create-react-app repo and cloned it locally
  2. Changed the package name in packages/react-scripts/package.json to be a new custom name
  3. Changed the 'react-scripts' reference in packages/react-scripts/scripts/init.js#L17 to match the new package name I chose
  4. Then I did a cd packages/react-scripts followed by an npm publish which published successfully
  5. Which then resulted in create-react-app test-app --scripts-version react-scripts-my-custom-package working as expected
@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 22, 2016

Member

it still seems like there's at least one issue that prevents this from working which is that the react-scripts package name is hardcoded in at least one spot, which won't work if you're using a custom forked package: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/scripts/init.js#L17

PR to fix this would be welcome. 😉

Member

gaearon commented Sep 22, 2016

it still seems like there's at least one issue that prevents this from working which is that the react-scripts package name is hardcoded in at least one spot, which won't work if you're using a custom forked package: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/scripts/init.js#L17

PR to fix this would be welcome. 😉

@ForbesLindesay

This comment has been minimized.

Show comment
Hide comment
@ForbesLindesay

ForbesLindesay Sep 22, 2016

Contributor

I'm actually in favour of (maybe) just telling people to fork the entire monorepo and publish create-whatever-app and whatever-scripts. It would be good if you didn't have to change react-scripts and create-react-app strings in 100 places as your first change though. I would suggest putting both of these strings in some kind of names.js package in each project. That way there would be just two places it would need changing.

I wonder if we should suggest people use code to generate their fork, rather than forking by hand. e.g. they could write code like overwrite webpack.config.js with this file. That way updating the fork would just mean re-running the code to generate the fork against the latest version of create-react-app.

Alternatively, should we just encourage people to hard-fork once create-react-app is sufficiently stable?

Contributor

ForbesLindesay commented Sep 22, 2016

I'm actually in favour of (maybe) just telling people to fork the entire monorepo and publish create-whatever-app and whatever-scripts. It would be good if you didn't have to change react-scripts and create-react-app strings in 100 places as your first change though. I would suggest putting both of these strings in some kind of names.js package in each project. That way there would be just two places it would need changing.

I wonder if we should suggest people use code to generate their fork, rather than forking by hand. e.g. they could write code like overwrite webpack.config.js with this file. That way updating the fork would just mean re-running the code to generate the fork against the latest version of create-react-app.

Alternatively, should we just encourage people to hard-fork once create-react-app is sufficiently stable?

gaearon added a commit that referenced this issue Sep 23, 2016

gaearon added a commit that referenced this issue Sep 23, 2016

gaearon added a commit that referenced this issue Sep 23, 2016

Don't hardcode react-scripts package name (#728)
* Don't hardcode react-scripts package name

Fixes issue described in #682 (comment).

* Update eject.js
@tonyxiao

This comment has been minimized.

Show comment
Hide comment
@tonyxiao

tonyxiao Sep 24, 2016

@kirkaustin exactly what I need as well. Will give that option a try.

tonyxiao commented Sep 24, 2016

@kirkaustin exactly what I need as well. Will give that option a try.

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 24, 2016

Member

The end result for me is that create-react-app fails at executing the init script.

This was fixed in 0.5.1, I removed hardcoded project name.

Member

gaearon commented Sep 24, 2016

The end result for me is that create-react-app fails at executing the init script.

This was fixed in 0.5.1, I removed hardcoded project name.

@kasperpeulen

This comment has been minimized.

Show comment
Hide comment
@kasperpeulen

kasperpeulen Sep 24, 2016

Contributor

I want to make a fork for react chrome extensions.

@gaearon You say that you can fork react-scripts. But react-scripts is not a git repo. Is the idea that I just copy the code of react-scripts in a new git repo and publish that to github?

Contributor

kasperpeulen commented Sep 24, 2016

I want to make a fork for react chrome extensions.

@gaearon You say that you can fork react-scripts. But react-scripts is not a git repo. Is the idea that I just copy the code of react-scripts in a new git repo and publish that to github?

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 24, 2016

Member

You can fork the whole repo but publish and change that single package.

Member

gaearon commented Sep 24, 2016

You can fork the whole repo but publish and change that single package.

@kitze

This comment has been minimized.

Show comment
Hide comment
@kitze

kitze Sep 25, 2016

Anyone has an idea why this forked version doesn't work?

I'm getting the same error as @dpoineau. When I'm changing the npm script in the package.json from "start": "custom-react-scripts start", to "start": "react-scripts start" then it works.

Probably it's a silly 1 line fix that I'm missing somewhere.

EDIT: i fixed this by renaming ./bin/react-scripts to ./bin/custom-react-scripts and also changed it in package.json

"bin": {
    "custom-react-scripts": "./bin/custom-react-scripts.js"
}

🎉

kitze commented Sep 25, 2016

Anyone has an idea why this forked version doesn't work?

I'm getting the same error as @dpoineau. When I'm changing the npm script in the package.json from "start": "custom-react-scripts start", to "start": "react-scripts start" then it works.

Probably it's a silly 1 line fix that I'm missing somewhere.

EDIT: i fixed this by renaming ./bin/react-scripts to ./bin/custom-react-scripts and also changed it in package.json

"bin": {
    "custom-react-scripts": "./bin/custom-react-scripts.js"
}

🎉

@clessg

This comment has been minimized.

Show comment
Hide comment
@clessg

clessg Sep 26, 2016

Tip to anybody using npm link in development to make changes to their react-scripts fork take effect immediately: comment out these lines. Otherwise, changes in your app won't be seen.

clessg commented Sep 26, 2016

Tip to anybody using npm link in development to make changes to their react-scripts fork take effect immediately: comment out these lines. Otherwise, changes in your app won't be seen.

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 26, 2016

Member

@clessg Ideally we wouldn’t have to do this. Do you have an alternative solution? We could completely get rid of remove-on-publish and only leave remove-on-eject. Let me file an issue.

Member

gaearon commented Sep 26, 2016

@clessg Ideally we wouldn’t have to do this. Do you have an alternative solution? We could completely get rid of remove-on-publish and only leave remove-on-eject. Let me file an issue.

@shubheksha

This comment has been minimized.

Show comment
Hide comment
@shubheksha

shubheksha Sep 26, 2016

Contributor

I just tried to summarize everything on this topic here:

Tweaking Configuration for React Scripts in Create React App.

Hope this helps!

Contributor

shubheksha commented Sep 26, 2016

I just tried to summarize everything on this topic here:

Tweaking Configuration for React Scripts in Create React App.

Hope this helps!

@kitze

This comment has been minimized.

Show comment
Hide comment
@kitze

kitze Sep 26, 2016

Thanks @shubheksha !

I also just published an article on this topic.

Configure create-react-app without ejecting ⏏

kitze commented Sep 26, 2016

Thanks @shubheksha !

I also just published an article on this topic.

Configure create-react-app without ejecting ⏏

@dvkndn

This comment has been minimized.

Show comment
Hide comment
@dvkndn

dvkndn Sep 27, 2016

Contributor

thank you all, I successfully created a fork of react-scripts and everything works! After all, now, it turns out to be very easy than I thought. Are anyone working to add this to document? @zperrault

Contributor

dvkndn commented Sep 27, 2016

thank you all, I successfully created a fork of react-scripts and everything works! After all, now, it turns out to be very easy than I thought. Are anyone working to add this to document? @zperrault

@g3r4n

This comment has been minimized.

Show comment
Hide comment
@g3r4n

g3r4n Apr 12, 2017

I'm trying to create a fork of react-scripts and got the following error when using it with CRA :
Error: Cannot find module 'react-dev-utils/crashOverlay'
This is because the react-dev-utils/crashOverlay.js file hasn't been publish on npm yet.
Publishing to npm from master seem to be a bad idea.

g3r4n commented Apr 12, 2017

I'm trying to create a fork of react-scripts and got the following error when using it with CRA :
Error: Cannot find module 'react-dev-utils/crashOverlay'
This is because the react-dev-utils/crashOverlay.js file hasn't been publish on npm yet.
Publishing to npm from master seem to be a bad idea.

@Timer

This comment has been minimized.

Show comment
Hide comment
@Timer

Timer Apr 12, 2017

Collaborator

Hi @g3r4n.
You should be forking 0.9.x for the time being, not master!

Collaborator

Timer commented Apr 12, 2017

Hi @g3r4n.
You should be forking 0.9.x for the time being, not master!

@g3r4n

This comment has been minimized.

Show comment
Hide comment
@g3r4n

g3r4n Apr 12, 2017

@Timer it's possible to fork a branch ? I think you fork the entirely repository not only a branch.
We should put in the documentation an explanation about creating a branch from a tag to avoid this issue.
As soon as I'll finish my customisation of react-scripts i will create a PR.

g3r4n commented Apr 12, 2017

@Timer it's possible to fork a branch ? I think you fork the entirely repository not only a branch.
We should put in the documentation an explanation about creating a branch from a tag to avoid this issue.
As soon as I'll finish my customisation of react-scripts i will create a PR.

@Timer

This comment has been minimized.

Show comment
Hide comment
@Timer

Timer Apr 13, 2017

Collaborator

We realized this caused a lot of pain for people tracking our fork (and will do this differently in the future), but effectively, you just need to switch branches on your end to 0.9.x and only work off there for now.

A PR would be appreciated to help steer people in the right direction for the time being.

Collaborator

Timer commented Apr 13, 2017

We realized this caused a lot of pain for people tracking our fork (and will do this differently in the future), but effectively, you just need to switch branches on your end to 0.9.x and only work off there for now.

A PR would be appreciated to help steer people in the right direction for the time being.

@viankakrisna

This comment has been minimized.

Show comment
Hide comment
@viankakrisna

viankakrisna Apr 13, 2017

Contributor

@g3r4n when you fork and clone to your local, the default branch is master. You can do
git checkout -b 0.9.x and git pull origin 0.9.x or if you haven't clone yet git clone YOURFORKURL -b 0.9.x and make changes there, commit, and do git push origin 0.9.x
and do pull request from there.

@Timer I agree it's better to treat master as the currently released branch. Maybe after 0.10 ?

Contributor

viankakrisna commented Apr 13, 2017

@g3r4n when you fork and clone to your local, the default branch is master. You can do
git checkout -b 0.9.x and git pull origin 0.9.x or if you haven't clone yet git clone YOURFORKURL -b 0.9.x and make changes there, commit, and do git push origin 0.9.x
and do pull request from there.

@Timer I agree it's better to treat master as the currently released branch. Maybe after 0.10 ?

@Timer

This comment has been minimized.

Show comment
Hide comment
@Timer

Timer Apr 13, 2017

Collaborator

@viankakrisna yes after 0.10 we'll probably merge breaking changes into next, and leave master as current working-tree for released versions

Collaborator

Timer commented Apr 13, 2017

@viankakrisna yes after 0.10 we'll probably merge breaking changes into next, and leave master as current working-tree for released versions

@sunnyvempati

This comment has been minimized.

Show comment
Hide comment
@sunnyvempati

sunnyvempati May 16, 2017

@zperrault quick follow up to your comment here: #682 (comment)

Is the solution to run npm publish within the react-scripts folder? Or is there a different way you went about accomplishing the publish?

sunnyvempati commented May 16, 2017

@zperrault quick follow up to your comment here: #682 (comment)

Is the solution to run npm publish within the react-scripts folder? Or is there a different way you went about accomplishing the publish?

@urimlmd

This comment has been minimized.

Show comment
Hide comment
@urimlmd

urimlmd Jun 8, 2017

@gaearon
I want to create a common infrastructure for several live products of the same company. This infrastructure is supposed to be opinionated and contain common APIs, configurations and UI components based on our style guide.
Currently each one of the products has it's own different frontend infrastructure, and the company would like to create a standard for new products in the first stage, and in the next stage, replace existing components with the component pool from the new infrastructure.

After reading a lot of resources regarding CRA, I understand that if there is a good way to achieve it with React, it is probably forking the repository and keep merging it with the stable branch
as described in https://auth0.com/blog/how-to-configure-create-react-app/

In general, I want to enjoy the goodies that CRA has to offer and get updates for free, but in addition, I would like to impose usage of some additional "flavors" that all teams will use.

One method I thought about is to fork the repository as described, run create-react-app, and then add some common components and utilities of our company.
Each new product will be basically a clone of this repository and additional changes will be added for it's own requirements. We will frequently update the core (and the existing products) as react-scripts gets updated.

Looking at above I still cannot answer a number of questions:

  1. Do you think create-react-app will fit our requirements?
  2. If the answer is positive, is it a good idea to create such a common infrastructure in the first place? Wouldn't it be better if we will create a new project each time with create-react-app, and just add common modules using npm install?
  3. Can you name some of the disadvantages of the methods stated in (2)?

Thanks.

urimlmd commented Jun 8, 2017

@gaearon
I want to create a common infrastructure for several live products of the same company. This infrastructure is supposed to be opinionated and contain common APIs, configurations and UI components based on our style guide.
Currently each one of the products has it's own different frontend infrastructure, and the company would like to create a standard for new products in the first stage, and in the next stage, replace existing components with the component pool from the new infrastructure.

After reading a lot of resources regarding CRA, I understand that if there is a good way to achieve it with React, it is probably forking the repository and keep merging it with the stable branch
as described in https://auth0.com/blog/how-to-configure-create-react-app/

In general, I want to enjoy the goodies that CRA has to offer and get updates for free, but in addition, I would like to impose usage of some additional "flavors" that all teams will use.

One method I thought about is to fork the repository as described, run create-react-app, and then add some common components and utilities of our company.
Each new product will be basically a clone of this repository and additional changes will be added for it's own requirements. We will frequently update the core (and the existing products) as react-scripts gets updated.

Looking at above I still cannot answer a number of questions:

  1. Do you think create-react-app will fit our requirements?
  2. If the answer is positive, is it a good idea to create such a common infrastructure in the first place? Wouldn't it be better if we will create a new project each time with create-react-app, and just add common modules using npm install?
  3. Can you name some of the disadvantages of the methods stated in (2)?

Thanks.

@uqee

This comment has been minimized.

Show comment
Hide comment
@uqee

uqee Jul 10, 2017

Have a look at my relevant article on Medium. Hope it helps as a starting point.

uqee commented Jul 10, 2017

Have a look at my relevant article on Medium. Hope it helps as a starting point.

@romaindso

This comment has been minimized.

Show comment
Hide comment
@romaindso

romaindso Jul 10, 2017

@Timer @viankakrisna

yes after 0.10 we'll probably merge breaking changes into next, and leave master as current working-tree for released versions

Can we have an update on this ? It seems that master still receive day to day udpdates.
The question behind is which source branch have to be used for maintaining a react-scripts fork ? (for now i'm still on the 0.9.x branch)

romaindso commented Jul 10, 2017

@Timer @viankakrisna

yes after 0.10 we'll probably merge breaking changes into next, and leave master as current working-tree for released versions

Can we have an update on this ? It seems that master still receive day to day udpdates.
The question behind is which source branch have to be used for maintaining a react-scripts fork ? (for now i'm still on the 0.9.x branch)

@Timer

This comment has been minimized.

Show comment
Hide comment
@Timer

Timer Jul 10, 2017

Collaborator

@romaindso we no longer will perform major react-scripts breakages on master, but this doesn't mean we won't update things daily on master. It should be safe to use again.

tl;dr maintain your fork off master.

Collaborator

Timer commented Jul 10, 2017

@romaindso we no longer will perform major react-scripts breakages on master, but this doesn't mean we won't update things daily on master. It should be safe to use again.

tl;dr maintain your fork off master.

@jimthedev

This comment has been minimized.

Show comment
Hide comment
@jimthedev

jimthedev May 21, 2018

@g3r4n did you every get it working? I am getting this error:

Error: Cannot find module 'react-dev-utils/browserHelper'

when trying to use the alpha for 2.0.0.

jimthedev commented May 21, 2018

@g3r4n did you every get it working? I am getting this error:

Error: Cannot find module 'react-dev-utils/browserHelper'

when trying to use the alpha for 2.0.0.

rrdelaney pushed a commit to reasonml-old/reason-scripts that referenced this issue May 23, 2018

Don't hardcode react-scripts package name (#728)
* Don't hardcode react-scripts package name

Fixes issue described in facebook/create-react-app#682 (comment).

* Update eject.js
@cliff76

This comment has been minimized.

Show comment
Hide comment
@cliff76

cliff76 Sep 13, 2018

Is this still a viable solution/alternative to eject? How would I add a fork of react-scripts to an existing project created with CRA? The command line doesn't seem to update/overwrite configs in an existing project. Also, when starting anew I'm also getting Error: Cannot find module 'react-dev-utils/browsersHelper

cliff76 commented Sep 13, 2018

Is this still a viable solution/alternative to eject? How would I add a fork of react-scripts to an existing project created with CRA? The command line doesn't seem to update/overwrite configs in an existing project. Also, when starting anew I'm also getting Error: Cannot find module 'react-dev-utils/browsersHelper

@jimthedev

This comment has been minimized.

Show comment
Hide comment
@jimthedev

jimthedev Sep 13, 2018

I got it working. I had to publish forks of each package and had to update all internal references to point at my packages. It’s a pain but I’m just maintaining it until 2.0 drops officially. Unfortunately it has enough custom parts I cannot publish publicly but could contribute to your fork if you have a place you want to work out of.

jimthedev commented Sep 13, 2018

I got it working. I had to publish forks of each package and had to update all internal references to point at my packages. It’s a pain but I’m just maintaining it until 2.0 drops officially. Unfortunately it has enough custom parts I cannot publish publicly but could contribute to your fork if you have a place you want to work out of.

@cliff76

This comment has been minimized.

Show comment
Hide comment
@cliff76

cliff76 Sep 13, 2018

Ouch! I see. Is there any way to update an existing project with a fork? We just started a project a couple of weeks ago via CRA and I need to make the smallest tweak to the webpack configs. I feel like I'm firing up a 747 just to visit my next door neighbor with this approach but I'm doing what I can to make things run.

cliff76 commented Sep 13, 2018

Ouch! I see. Is there any way to update an existing project with a fork? We just started a project a couple of weeks ago via CRA and I need to make the smallest tweak to the webpack configs. I feel like I'm firing up a 747 just to visit my next door neighbor with this approach but I'm doing what I can to make things run.

@cliff76

This comment has been minimized.

Show comment
Hide comment
@cliff76

cliff76 Sep 13, 2018

Also, does each fork need to have its package name updated to be different from the official repo?

cliff76 commented Sep 13, 2018

Also, does each fork need to have its package name updated to be different from the official repo?

@jimthedev

This comment has been minimized.

Show comment
Hide comment
@jimthedev

jimthedev Sep 13, 2018

jimthedev commented Sep 13, 2018

@cliff76

This comment has been minimized.

Show comment
Hide comment
@cliff76

cliff76 Sep 13, 2018

I saw this earlier and lost the link! Does it actually work? I'll have to give it a shot. Thanks!

cliff76 commented Sep 13, 2018

I saw this earlier and lost the link! Does it actually work? I'll have to give it a shot. Thanks!

@cliff76

This comment has been minimized.

Show comment
Hide comment
@cliff76

cliff76 Sep 14, 2018

By the way, that works like a charm, thanks!

cliff76 commented Sep 14, 2018

By the way, that works like a charm, thanks!

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