Project generated with https://github.com/about-code/ng-mono
- get the sources from version control
cd
into project folder- run
npm install
- build optimized production bundle:
npm run build
- build and serve optimized production build:
npm run build-serve
- build and serve debuggable development build:
npm start
With this structure in place packages can be built compatible to Angular Package Format using:
npm run build-pkg
Note: The package build script uses ng-packagr under the hood. You might need to tweak
ng-package.json
based on your requirements and external package dependencies. If you have issues building packages (e.g. packages with third-party dependencies) have a look at ng-packagr and its docs.
Use npm run lerna -- publish
to version packages (see lernajs.io). Unless you develop for node don't run lerna bootstrap
even if its said to be crucial. It links packages which is crucial for node development but not required if you build an Angular web app which gets bundled with webpack. Symlinks might even cause more problems with webpack than they solve.
Note: Edit
lerna.json
to change from individual-version strategy to a common-version strategy
- Run Karma Unit Tests with
npm run test
- Convention: Unit test specs must end with
.spec.ts
- Note: To choose other browsers or customize the setup edit
config/karma.conf.js
.
- Before you run tests the very first time:
npm run webdriver-manager update
- Run Application (console 1):
npm start
- Run Tests locally (console 2):
npm run test-e2e
- Convention: E2E test specs must end with
-e2e.ts
- Note: To customize the setup edit
config/protractor.js
.
- Building Angular Libraries (https://www.youtube.com/watch?v=unICbsPGFIA)