Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 14, 2021 12:38 pm GMT

Monorepo With Yarn Workspaces

1. Monorepo

Monorepo Monolithic Repositories , . ? Multi-repo, PolyRepo .

A  -> A B  -> B 

Monorepo .

A  B   -> Mono C  

.

image

2. Monorepo

Monorepo , ,
.

2.1.

2.1.1. .
( .) . IDE , IDE IDE .

2.1.2. .
A, B, C, D Monorepo , , E A~D import .

2.1.3. .
A, B, C, D react 16.11.0 , react 16.11.0 root react 16.11.0 A~D .

2.2.

2.2.1. , .
, .

2.2.2. .
Monorepo , .

2.2.3. .
Monorepo , , node_module .

3. Monorepo

Monorepo , yarn workspace .

3.1. yarn workspace

node package manager yarn (npm !!) workspace monorepo .

3.2. Lerna

Lerna node moudule, yarn workspace monorepo , clean monorepo package npm .

3.3. git submodule

multi-repo , monorepo git submodule . git submodule submodule .

4. yarn workspace Monorepo

yarn workspace monorepo .

yarn init

, package.json private workspaces .

// package.json{  ...  "private": true,  "workspaces": [    "packages/*"  ],  ...}

4.1.

, root node_modules , symlink .

image

5. yarn workspace

(yarn workspace, lerna, git submodule) , lerna npm npm git submodule multi-repo monorepo monorepo , monorepo yarn workspace .

6. Trouble Shooting

yarn workspace root node_modules , , .

, monorepo components , storybook babel-loader 8.22.0 , create-react-app , cra babel-loader 8.1.0 .
components babel-loader 8.1.0 .


Original Link: https://dev.to/pyeongoh5/monorepo-with-yarn-workspaces-325m

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To