You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***build:** fail ng build on error ([#2360](https://github.com/angular/angular-cli/issues/2360)) ([aa48c30](https://github.com/angular/angular-cli/commit/aa48c30)), closes [#2014](https://github.com/angular/angular-cli/issues/2014)
8
+
***build:** use config output path as default ([#2158](https://github.com/angular/angular-cli/issues/2158)) ([49a120b](https://github.com/angular/angular-cli/commit/49a120b))
9
+
***generate:** Update directive.spec.ts blueprint to fix incorret import ([#1940](https://github.com/angular/angular-cli/issues/1940)) ([93da512](https://github.com/angular/angular-cli/commit/93da512))
10
+
***karma:** set defaults for karma.conf.js ([#1837](https://github.com/angular/angular-cli/issues/1837)) ([e2e94a5](https://github.com/angular/angular-cli/commit/e2e94a5))
Copy file name to clipboardExpand all lines: README.md
+50-21Lines changed: 50 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,16 @@ Prototype of a CLI for Angular 2 applications based on the [ember-cli](http://ww
13
13
14
14
This project is very much still a work in progress.
15
15
16
-
The CLI is now in beta.
16
+
The CLI is now in beta.
17
17
If you wish to collaborate while the project is still young, check out [our issue list](https://github.com/angular/angular-cli/issues).
18
18
19
19
## Webpack update
20
20
21
-
We changed the build system between beta.10 and beta.12, from SystemJS to Webpack.
22
-
And with it comes a lot of benefits.
21
+
We changed the build system between beta.10 and beta.14, from SystemJS to Webpack.
22
+
And with it comes a lot of benefits.
23
23
To take advantage of these, your app built with the old beta will need to migrate.
24
24
25
-
You can update your `beta.10` projects to `beta.12` by following [these instructions](https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14).
25
+
You can update your `beta.10` projects to `beta.14` by following [these instructions](https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14).
26
26
27
27
## Prerequisites
28
28
@@ -41,6 +41,7 @@ The generated project has dependencies that require **Node 4.x.x and NPM 3.x.x**
41
41
*[Adding extra files to the build](#adding-extra-files-to-the-build)
*[Deploying the App via GitHub Pages](#deploying-the-app-via-github-pages)
45
46
*[Linting and formatting code](#linting-and-formatting-code)
46
47
*[Support for offline applications](#support-for-offline-applications)
@@ -108,6 +109,7 @@ Service | `ng g service my-new-service`
108
109
Class | `ng g class my-new-class`
109
110
Interface | `ng g interface my-new-interface`
110
111
Enum | `ng g enum my-new-enum`
112
+
Module | `ng g module my-module`
111
113
112
114
### Generating a route
113
115
@@ -125,8 +127,8 @@ The build artifacts will be stored in the `dist/` directory.
125
127
126
128
### Build Targets and Environment Files
127
129
128
-
`ng build` can specify both a build target (`--target=production` or `--target=development`) and an
129
-
environment file to be used with that build (`--environment=dev` or `--environment=prod`).
130
+
`ng build` can specify both a build target (`--target=production` or `--target=development`) and an
131
+
environment file to be used with that build (`--environment=dev` or `--environment=prod`).
130
132
By default, the development build target and environment are used.
131
133
132
134
The mapping used to determine which environment file is used can be found in `angular-cli.json`:
@@ -156,7 +158,7 @@ ng build
156
158
157
159
You can also add your own env files other than `dev` and `prod` by doing the following:
158
160
- create a `src/environments/environment.NAME.ts`
159
-
- add `{ "NAME": 'src/environments/environment.NAME.ts' }` to the the `apps[0].environments` object in `angular-cli.json`
161
+
- add `{ "NAME": 'src/environments/environment.NAME.ts' }` to the the `apps[0].environments` object in `angular-cli.json`
160
162
- use them via the `--env=NAME` flag on the build/serve commands.
161
163
162
164
### Base tag handling in index.html
@@ -171,7 +173,7 @@ ng build --bh /myUrl/
171
173
172
174
### Bundling
173
175
174
-
All builds make use of bundling, and using the `--prod` flag in `ng build --prod`
176
+
All builds make use of bundling, and using the `--prod` flag in `ng build --prod`
175
177
or `ng serve --prod` will also make use of uglifying and tree-shaking functionality.
176
178
177
179
### Running unit tests
@@ -192,6 +194,33 @@ Before running the tests make sure you are serving the app via `ng serve`.
192
194
193
195
End-to-end tests are run via [Protractor](https://angular.github.io/protractor/).
194
196
197
+
### Proxy To Backend
198
+
Using the proxying support in webpack's dev server we can highjack certain urls and send them to a backend server.
199
+
We do this by passing a file to `--proxy-config`
200
+
201
+
Say we have a server running on `http://localhost:3000/api` and we want all calls th `http://localhost:4200/api` to go to that server.
202
+
203
+
We create a file next to projects `package.json` called `proxy.conf.json`
204
+
with the content
205
+
206
+
```
207
+
{
208
+
"/api": {
209
+
"target": "http://localhost:3000",
210
+
"secure": false
211
+
}
212
+
}
213
+
```
214
+
215
+
You can read more about what options are available here [webpack-dev-server proxy settings](https://webpack.github.io/docs/webpack-dev-server.html#proxy)
216
+
217
+
and then we edit the `package.json` file's start script to be
0 commit comments