Skip to content

Commit 17de707

Browse files
committed
chore(docs): add webpack update instructions
1 parent f1808c3 commit 17de707

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ This project is very much still a work in progress.
1616
The CLI is now in beta.
1717
If you wish to collaborate while the project is still young, check out [our issue list](https://github.com/angular/angular-cli/issues).
1818

19+
## Webpack preview release update
20+
21+
We're updating the build system in Angular-CLI to use webpack instead of Broccoli.
22+
23+
You can install and update your projects using [these instructions](https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md).
24+
1925
## Prerequisites
2026

2127
The generated project has dependencies that require **Node 4 or greater**.

WEBPACK_UPDATE.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Upgrading from [email protected] to the [email protected]
2+
3+
To update `angular-cli` to the webpack preview, you must update both the global package, project's local package and your project files.
4+
5+
## Global package:
6+
```
7+
npm uninstall -g angular-cli
8+
npm cache clean
9+
npm install -g [email protected]
10+
```
11+
12+
## Local project package:
13+
```
14+
rm -rf node_modules dist tmp typings
15+
npm install --save-dev [email protected]
16+
```
17+
18+
IMPORTANT NOTE:
19+
Currently project generated with `ng new` will use a wrong CLI version (see https://github.com/angular/angular-cli/issues/1528). After initializing your project, run `npm install --save-dev [email protected]` to set the correct version.
20+
21+
## Project files
22+
23+
You will need to run `ng init` to check for changes in all the auto-generated files created by `ng new` and allow you to update yours. You are offered four choices for each changed file: `y` (overwrite), `n` (don't overwrite), `d` (show diff between your file and the updated file) and `h` (help).
24+
25+
Carefully read the diffs for each code file, and either accept the changes or incorporate them manually after `ng init` finishes.
26+
27+
You can find a sample github diff of the changes introduced between a beta.10 and webpack preview project at https://github.com/filipesilva/angular-cli-webpack-upgrade/commit/HEAD.
28+
29+
Here is a summary of the file changes:
30+
31+
1. Updated files:
32+
* `./config/karma.conf.js` - `frameworks`/`plugins`/`files`/`exclude`/`preprocessors` entries changed, added `angularCliConfig` entry.
33+
* `./e2e/tsconfig.json` - property cleanup, changed `outdir`, added `typeRoots`
34+
* `./angular-cli.json` - updated version entry.
35+
* `./README.md` - updated version entry, removed route from generator list.
36+
* `./package.json` - removed typings postinstall script, removed `ember-cli-inject-live-reload`/`es6-shim`/`systemjs` dependencies, added `core-js`/`ts-helpers` dependencies, updated `angular-cli`/`codelyzer`/`ts-node`/`ts-lint`/`typescript` devDependencies, added `@types/jasmine`/`@types/protractor`/`karma-coverage` devDependencies.
37+
* `./src/app/app.component.ts` (and all other components) - removed `module.id`.
38+
* `./src/app/index.ts` - import adjusted due to environment files moving (see below).
39+
* `./src/index.html` - removed templating tags and `SystemJS` import script.
40+
* `./src/app/tsconfig.json` - property cleanup, changed `outdir`/`module`, added `libs`/`typeRoots`/`types`
41+
* `./src/typings.d.ts` - added `System`/`require` typings, removed `typings` ref
42+
1. New files:
43+
* `./src/polyfills.ts` - loads needed polyfills before main app
44+
* `./src/test.ts` - unit test spec loader
45+
1. These files have moved to `./src/app/environments/`:
46+
* `./config/environment.dev.ts`
47+
* `./config/environment.prod.ts`
48+
* `./src/app/environment.ts`
49+
50+
Lastly, you can delete these files as they are not needed anymore.
51+
* `./config/karma-test-shim.js`
52+
* `./src/system-config.ts`
53+
* `./angular-cli-build.js`
54+
* `./typings.json`
55+
* `./.clang-format` (if present)

0 commit comments

Comments
 (0)