Refactor readme and npm scripts.

This commit is contained in:
Spencer Ofwiti 2021-03-18 20:31:50 +03:00
parent d1563092b2
commit 156f9d1875
2 changed files with 13 additions and 11 deletions

View File

@ -10,7 +10,7 @@ Run `npm install -g @angular/cli` to install the angular CLI.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
Run `npm run start:dev` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
@ -22,11 +22,11 @@ Run `ng generate module module-name --route module-name --module app.module` to
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
Run `npm run build:dev` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `build:prod` script for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
Run `npm run test:dev` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
@ -34,8 +34,9 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac
## Environment variables
Environment variables are contained in the directory `src/environments/`
Environment variables are contained in the `.env` file. See `.env.example` for a template.
Once loaded they will be populated in the directory `src/environments/`.
It contains environment variables for development on `environment.ts` and production on `environment.prod.ts`.
## Further help

View File

@ -3,13 +3,14 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"config": "ts-node set-env.ts",
"start:dev": "npm run config --environment=dev && ng serve",
"start:prod": "npm run config --environment=prod && ng serve",
"build:dev": "npm run config --environment=dev && ng build",
"build:prod": "npm run config --environment=prod && ng build --prod",
"test:dev": "npm run config --environment=dev && ng test",
"test:prod": "npm run config --environment=prod && ng test",
"config:dev": "ts-node set-env.ts --environment=dev",
"config:prod": "ts-node set-env.ts --environment=prod",
"start:dev": "npm run config:dev && ng serve",
"start:prod": "npm run config:prod && ng serve",
"build:dev": "npm run config:dev && ng build",
"build:prod": "npm run config:prod && ng build --prod",
"test:dev": "npm run config:dev && ng test",
"test:prod": "npm run config:prod && ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "node patch-webpack.js"