Skip to content

Commit 79f1a00

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

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

README.md

+6
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

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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`, sass/less/stylus preprocessing now uses the real extension in `styleUrls` instead of `.css`.
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. Mobile app updated files:
43+
* `./package.json` - local versions of `angular2-universal` now used by the build system, updated package versions.
44+
* `./src/index.html` - moved service worker code to build system, hardcoded icons.
45+
* `./src/main-app-shell.ts` - reworked to interface with the build system, see comments in file.
46+
1. New files:
47+
* `./src/polyfills.ts` - loads needed polyfills before main app
48+
* `./src/test.ts` - unit test spec loader
49+
1. These files have moved to `./src/app/environments/`:
50+
* `./config/environment.dev.ts`
51+
* `./config/environment.prod.ts`
52+
* `./src/app/environment.ts`
53+
54+
Lastly, you can delete these files as they are not needed anymore.
55+
* `./config/karma-test-shim.js`
56+
* `./src/system-config.ts`
57+
* `./angular-cli-build.js`
58+
* `./typings.json`
59+
* `./.clang-format` (if present)

0 commit comments

Comments
 (0)