A collection of utilities for Webiny project.
If you've ever created a project using create-react-app
you know its config is hidden from you unless you eject, which isn't really a good option because you won't receive any new updates they ship for react-scripts
. Besides, react-sripts
does not support monorepos. So the good people at rescripts created this tool to override react-scripts
without ejecting 🎉 .
In each of your React apps setup by Webiny CLI, you will find a .rescriptsrc.js
file which loads a Webiny rescript from @webiny/project-utils/cra
(you can add more rescripts here if you like).
When running a build of your React app, we run rescripts
(see package.json
scripts), which intercepts the webpack config generated by react-scripts
and allow you to modify it. In our rescript we enable babelrc
files and also add all your monorepo packages to webpack's resolve.alias
to make them accessible from your React app.
A quick overview of tools included in this package:
-
aliases
- createsjest
andwebpack
aliases. -
cra
- this is our rescript to get a CRA app to work as we want it to. Again, tweak it to your heart's content :) -
packages
- simply loads monorepo packages usingget-yarn-workspaces
package.