# cra-workspaces

> Compile yarn workspaces as a part of your create-react-app

Latest version **2.0.0** (published 2020-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install cra-workspaces
pnpm add cra-workspaces
yarn add cra-workspaces
bun add cra-workspaces
```

Provides the command `cra-workspaces`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-01-30 |
| First published | 2018-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Elvin Dzhavadov |
| Maintainers | elv1n |

## Links

- npm: https://www.npmjs.com/package/cra-workspaces
- Repository: https://github.com/elv1n/cra-workspaces
- Issues: https://github.com/elv1n/cra-workspaces/issues
- npm.io page: https://npm.io/package/cra-workspaces

## Dependencies (7)

- [globby](https://npm.io/package/globby.md) ^11.0.0
- [find-pkg](https://npm.io/package/find-pkg.md) ^2.0.0
- [find-root](https://npm.io/package/find-root.md) ^1.1.0
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.1
- [mock-require](https://npm.io/package/mock-require.md) ^3.0.2
- [@rescripts/cli](https://npm.io/package/@rescripts/cli.md) ^0.0.13
- [@rescripts/utilities](https://npm.io/package/@rescripts/utilities.md) ^0.0.6

## Recent versions

- 2.0.0 (latest) — 2020-01-30
- 1.0.1 — 2018-11-08
- 1.0.0 — 2018-11-08

## README

# Run create-react-app 3 with workspaces

[![npm version](https://img.shields.io/npm/v/cra-workspaces.svg)](https://www.npmjs.com/package/cra-workspaces)
[![npm monthly downloads](https://img.shields.io/npm/dm/cra-workspaces.svg)](https://www.npmjs.com/package/cra-workspaces)

> All you have to do is create your app using [create-react-app](https://github.com/facebookincubator/create-react-app) and install cra-workspaces.

⚠️ **Please Note:**

> By doing this you're breaking the ["guarantees"](https://github.com/facebookincubator/create-react-app/issues/99#issuecomment-234657710) that CRA provides. That is to say you now "own" the configs. **No support** will be provided. Proceed with caution.

The goal of this package is to make a monorepo using [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) to share common code across a Create React App 2+ (CRA).
It runs create-react-app with yarn workspaces without config files or using 'eject'

# Getting started

#### 1) Install cra-workspaces
```bash
$ yarn add cra-workspaces -D
```

#### 2) 'Flip' the existing calls to `react-scripts` in `npm` scripts
```diff
  /* package.json */

  "scripts": {
-   "start": "react-scripts start",
+   "start": "cra-workspaces start",
-   "build": "react-scripts build",
+   "build": "cra-workspaces build",
}
```

#### 3) Start the Dev Server
```bash
$ yarn start
```


#### 4) Build your app
```bash
$ yarn build
```

---
_Source: https://npm.io/package/cra-workspaces · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
