create angular workspace with monorepo code example
Example 1: how to create monorapo project in angular 8
"scripts": { "ng": "ng", "start:Core": "ng serve --port 4444", #start CoreApp in dev mode* "start:app1": "ng serve app1 --port 4422", #start App1 in dev mode "start:app2": "ng serve app2 --port 4423", #start App2 in dev mode "build:core": "ng build --prod --stats-json", #build CoreApp "build:admin-lib": "ng build admin-lib", #build admin-lib library "build:app1": "ng build app1", # build App1 "build:app2": "ng build app2", # build App2 "test:core": "ng test", # run jasmine unit tests for CoreApp "test:app1": "ng test app1", # run jasmine unit tests for App1 "test:app2": "ng test app2", # run jasmine unit tests for App2 "lint:core": "ng lint", # run lint unit tests for CoreApp "lint:app1": "ng lint app1", # run lint unit tests for App1 "lint:app2": "ng lint app2", # run lint unit tests for App2 "e2e": "ng e2e"},
Example 2: how to create monorapo project in angular 8
npm install -g @angular/cli # in case you don't have it installedng new CoreApp --routing=true # creates main CoreApp with routingng generate application app1 # creates app1 applciation ng generate application app2 # creates app2 applciationng generate lib admin-lib # creates admin-lib component library
Example 3: how to create monorapo project in angular 8
platform-directory/
|
---apps/
| |
| ---app1/
| |
| ---app2/
|
---library1/
| |
| ---src/
|
---library2/
| |
| ---src/
|
---angular.json
|
---package.json
|
---README.md
|
---tsconfig.json