I'm trying to maintain a separate fork of react-scripts@next with some webpack configuration changes that I want to use without ejecting. I'm noticing that if I branch from the commit
[email protected] then change the package JSON information and publish to my specific npm account, when I try to install my own version I get prompted with:
Please choose a version of "babel-plugin-named-asset-import" from this list:
1.0.0-next.b2fd8db8
1.0.0-next.a671462c
1.0.0-next.66cc7a90
I picked a671462c since it's the same hash as the scripts version is branched out of, but I end up with Error: Cannot find module 'react-dev-utils/browsersHelper'.
I know this may not be supported by you guys directly, but I was wondering if anyone could give me some insight on how to fix this.
Thanks in advance!
ah disregard - it appears that it's picking up the version in the package.json file because I'm not deploying using lerna.
Same problem.
How did you solve it?
@jcmandersson, I didn't solve it.
The issue is that the package dependencies are being automatically updated when you deploy via lerna to match one another - if you look at the dependency list after installing CRA's next versus a fork of next, they are completely different. So essentially what you would need to do is update every package (not just react-scripts) to your own name in the various package.json files, update the requires to pull in your version of said package, then do a publish to your own npm.
I felt like that was too many hurdles to deal with and would make merging any upstream changes challenging, so I decided to go with a different route.
@sowhatdoido I actually passed through it, and I'm curious, what different route did you go with?
@GabrielDuarteM,
Sorry, I don't understand what you mean by passed through it - I assume you meant you ran into the same problem?
I'd highly recommend looking at React App Rewired if you are only looking for a quick way to add some features to CRA 1.0, but I ultimately decided to see if I can't maintain my own stack as an exercise to understand everything a little better.
Thanks @sowhatdoido
I took a completely different route with next.js and created my own boilerplate repo. Not ideal since it will be hard to keep the boilerplate code (like webpack config) updated for old projects. But good enough for me right now.
Most helpful comment
@jcmandersson, I didn't solve it.
The issue is that the package dependencies are being automatically updated when you deploy via lerna to match one another - if you look at the dependency list after installing CRA's next versus a fork of next, they are completely different. So essentially what you would need to do is update every package (not just react-scripts) to your own name in the various
package.jsonfiles, update the requires to pull in your version of said package, then do a publish to your own npm.I felt like that was too many hurdles to deal with and would make merging any upstream changes challenging, so I decided to go with a different route.