Skip to content

Commit 407fde0

Browse files
authored
Merge branch 'master' into refactor-platform-server
2 parents 5788df0 + c8e5359 commit 407fde0

File tree

27 files changed

+131
-46
lines changed

27 files changed

+131
-46
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ ng serve
5757
```
5858
Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
5959

60-
You can configure the default HTTP port and the one used by the LiveReload server with two command-line options :
60+
You can configure the default HTTP host and port used by the development server with two command-line options :
6161

6262
```bash
63-
ng serve --host 0.0.0.0 --port 4201 --live-reload-port 49153
63+
ng serve --host 0.0.0.0 --port 4201
6464
```
6565

6666
### Generating Components, Directives, Pipes and Services
@@ -88,6 +88,7 @@ Directive | `ng g directive my-new-directive`
8888
Pipe | `ng g pipe my-new-pipe`
8989
Service | `ng g service my-new-service`
9090
Class | `ng g class my-new-class`
91+
Guard | `ng g guard my-new-guard`
9192
Interface | `ng g interface my-new-interface`
9293
Enum | `ng g enum my-new-enum`
9394
Module | `ng g module my-module`
@@ -111,7 +112,7 @@ npm install -g @angular/cli@latest
111112

112113
Local project package:
113114
```bash
114-
rm -rf node_modules dist # use rmdir on Windows
115+
rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
115116
npm install --save-dev @angular/cli@latest
116117
npm install
117118
```

docs/documentation/build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ or `ng serve --prod` will also make use of uglifying and tree-shaking functional
103103

104104
`--target` (`-t`) Defines the build target.
105105

106-
`--vendor-chunk` (`-vb`) Use a separate bundle containing only vendor libraries.
106+
`--vendor-chunk` (`-vc`) Use a separate bundle containing only vendor libraries.
107107

108108
`--verbose` (`-v`) Adds more details to output logging.
109109

110-
`--watch` (`-w`) Run build when files change.
110+
`--watch` (`-w`) Run build when files change.

docs/documentation/generate/interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
## Options
99
`--app` Specifies app name or index to use.
1010

11-
`type` Pptional String to specify the type of interface.
11+
`type` Optional String to specify the type of interface.

docs/documentation/home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ End-to-end tests are run via [Protractor](https://angular.github.io/protractor/)
5555

5656
### Additional Information
5757
There are several [stories](stories) which will walk you through setting up
58-
additional aspects of Angular applciations.
58+
additional aspects of Angular applications.

docs/documentation/serve.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ All the build Options are available in serve below are the additional options.
2424

2525
`--ssl-cert` SSL certificate to use for serving HTTPS.
2626

27-
`--ssl-key` SSL key to use for serving HTTPS.
27+
`--ssl-key` SSL key to use for serving HTTPS.
28+
29+
## Note
30+
When running `ng serve`, the compiled output is served from memory, not from disk. This means that the application being served is not located on disk in the `dist` folder.

docs/documentation/stories.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
- [Routing](stories/routing)
2121
- [3rd Party Lib](stories/third-party-lib)
2222
- [Corporate Proxy](stories/using-corporate-proxy)
23+
- [Serve from Disk](stories/disk-serve)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Serve from Disk
2+
3+
The CLI supports running a live browser reload experience to users by running `ng serve`. This will compile the application upon file saves and reload the browser with the newly compiled application. This is done by hosting the application in memory and serving it via [webpack-dev-server](https://webpack.js.org/guides/development/#webpack-dev-server).
4+
5+
If you wish to get a similar experience with the application output to disk please use the steps below. This practice will allow you to ensure that serving the contents of your `dist` dir will be closer to how your application will behave when it is deployed.
6+
7+
## Environment Setup
8+
### Install a web server
9+
You will not be using webpack-dev-server, so you will need to install a web server for the browser to request the application. There are many to choose from but a good one to try is [lite-server](https://github.com/johnpapa/lite-server) as it will auto-reload your browser when new files are output.
10+
11+
## Usage
12+
You will need two terminals to get the live-reload experience. The first will run the build in a watch mode to compile the application to the `dist` folder. The second will run the web server against the `dist` folder. The combination of these two processes will mimic the same behavior of ng serve.
13+
14+
### 1st terminal - Start the build
15+
```bash
16+
ng build --watch
17+
```
18+
19+
### 2nd terminal - Start the web server
20+
```bash
21+
lite-server --baseDir="dist"
22+
```
23+
When using `lite-server` the default browser will open to the appropriate URL.

docs/documentation/stories/include-angular-material.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { MaterialModule } from '@angular/material';
2424
@NgModule({
2525
imports: [
2626
...
27-
MaterialModule.forRoot()
27+
MaterialModule
2828
],
2929
...
3030
})

docs/documentation/stories/rc-update.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,17 @@ Packages in `dependencies`:
320320
- `@angular/*` packages now have a `^2.4.0` minimum (`^3.4.0` for router)
321321
- `core-js` remains unchanged at `^2.4.1`
322322
- `rxjs` to `^5.1.0`
323+
- `ts-helpers` was **removed**
323324
- `zone.js` to `^0.7.6`
324325

325-
Packages in `dependencies`:
326+
Packages in `devDependencies`:
326327
- `@angular/cli` at `1.0.0-rc.0` replaces `angular-cli`
327328
- `@angular/compiler-cli` is also at `^2.4.0`
328329
- `@types/jasmine` remains unchanged and pinned at `2.5.38`
329330
- `@types/node` was updated to `~6.0.60`
330331
- `codelyzer` was updated to `~2.0.0`
331332
- `jasmine-core` was updated to `~2.5.2`
332-
- `jasmine-spec-reporter` was **removed**
333+
- `jasmine-spec-reporter` was updated to `~3.2.0`
333334
- `karma` was updated to `~1.4.1`
334335
- `karma-chrome-launcher` was updated to `~2.0.0`
335336
- `karma-cli` was updated to `~1.0.1`
@@ -353,6 +354,7 @@ We also updated the scripts section to make it more simple:
353354
"scripts": {
354355
"ng": "ng",
355356
"start": "ng serve",
357+
"build": "ng build",
356358
"test": "ng test",
357359
"lint": "ng lint",
358360
"e2e": "ng e2e"

docs/documentation/test.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ You can run tests with coverage via `--code-coverage`. The coverage report will
2020

2121
`--browsers` Override which browsers tests are run against.
2222

23-
`--build` Build prior to running tests.
24-
2523
`--code-coverage` Coverage report will be in the coverage/ directory.
2624

2725
`--colors` Enable or disable colors in the output (reporters and logs).

0 commit comments

Comments
 (0)