https://github.com/with-heart/react-app-rewire-workspaces
react-app-rewired module enabling yarn workspaces
https://github.com/with-heart/react-app-rewire-workspaces
Last synced: 4 months ago
JSON representation
react-app-rewired module enabling yarn workspaces
- Host: GitHub
- URL: https://github.com/with-heart/react-app-rewire-workspaces
- Owner: with-heart
- Archived: true
- Created: 2019-02-23T15:43:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-28T00:13:05.000Z (over 5 years ago)
- Last Synced: 2025-01-13T19:46:26.974Z (5 months ago)
- Language: JavaScript
- Size: 146 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-app-rewire-workspaces
A `react-app-rewired` module enabling `yarn` workspaces in `create-react-app` projects
## Installation
Install the package:
`yarn add -D react-app-rewire-workspaces`
Make sure you also have [`react-app-rewired`](https://github.com/timarney/react-app-rewired) installed:
`yarn add -D react-app-rewired`
It's also recommended that you install [`customize-cra`](https://github.com/arackaf/customize-cra) as it's the easiest way to consume `react-app-rewire-workspaces`:
`yarn add -D customize-cra`
## Usage
`react-app-rewired` is driven by a `config-overrides.js` file in the root of your CRA directory. From there, we can import `enableWorkspaces` from `react-app-rewire-workspaces` and call it:
```js
const enableWorkspaces = require('react-app-rewire-workspaces')module.exports = function override(config, env) {
config = enableWorkspaces()(config, env)return config
}
```It's even easier if you use `customize-cra`:
```js
const {override} = require('customize-cra')
const enableWorkspaces = require('react-app-rewire-workspaces')module.exports = override(enableWorkspaces())
```