This is a boilerplate project for a create-react-app application inside a yarn and lerna workspace.
There is a main app package that uses a webpack development server by means of the default CRA setup (via react-scripts).
Any additional packages can be transpiled and watched and they are available for import in the app.
-
Clone this repository and remove the
.gitfolder. -
Run a search and replace for the project namespace. Search for
@namespaceand insert your own, e.g.@foo -
Finally, run
yarnoryarn installin the project root to install the dependencies and create the package symlinks.
Note: Make sure to replace the occurances of @namespace before you run yarn install!
yarn start
This starts both the app and watch scripts in parallel.
yarn app
This starts the development server for the app package.
yarn watch
This runs yarn watch in all packages that do have a watch script defined in their package.json.
scripts/create-package.sh
This creates a new package with some defaults, based on scripts/templates/package.
The package will automatically have a build script that transpiles src/ to lib/, and a watch script that does the same but recompiles upon file change.