-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
react-cra example as mono repo #507
Comments
@marsh73 What issue were you running into? I got stuck here:
Because it is searching for |
I was struggling to get this to work in our production build so i cloned the examples to see if i could make my own mono repo and getting it to work... it feels close but I get the above whether i build or test. cc: @alexeagle |
It's looking for package.json in the working directory, so I think you just need to chdir into the package for that relative filesystem lookup to work. (Bazel always runs programs with the monorepo root as the working directory, so rules_js follows that convention as our default for consistency) |
@alexeagle you are so quick... thank you... worked perf... going to work on converting our production web build file now.... 🤞 |
@marsh73 Are you all set with this question? If so, can we close it? |
@marsh73 I gave the CRA example an upgrade recently: https://github.com/aspect-build/bazel-examples/tree/main/react-cra. A added jest test targets, eslint targets, separate ts_project transpilation targets for application code and specs. The react-scripts "build" target no longer does any transpilation since that is done in fine grained ts_project targets. |
I'll make another PR to re-organize the code so it looks more like it would in a monorepo with the react-scripts build target not in the root BUILD file |
I'm able to recreate the example of react-cra when the WORKSPACE and BUILD.bazel file are in the same directory. But when I try and move the source files, along with the BUILD file into a sub directory and update the targets in the WORKSPACE, I'm not able to get it working. Looks like all the examples at https://github.com/aspect-build/bazel-examples have these files in the same root. Do you have an example of what the react-scripts in a subdirectory might look like?
The text was updated successfully, but these errors were encountered: