Skip to content

Commit 8db929b

Browse files
committed
docs: add HMR no AOT note
Partially address #8234
1 parent d2e22b2 commit 8db929b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

docs/documentation/stories/configure-hmr.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,20 @@ Update `.angular-cli.json` by adding the new environment the existing environmen
5555
Run `ng serve` with the flag `--hmr -e=hmr` to enable hmr and select the new environment:
5656

5757
```bash
58-
ng serve --hmr -e=hmr
58+
ng serve --hmr -e=hmr --no-aot
5959
```
6060

6161
Create a shortcut for this by updating `package.json` and adding an entry to the script object:
6262

6363
```json
6464
"scripts": {
6565
...
66-
"hmr": "ng serve --hmr -e=hmr"
66+
"hmr": "ng serve --hmr -e=hmr --no-aot"
6767
}
6868
```
6969

70+
Note: you cannot use HMR when AOT is turned on, so you must force it off with `--no-aot`.
71+
7072

7173
### Add dependency for @angularclass/hmr and configure app
7274

lib/bootstrap-local.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ if (!__dirname.match(new RegExp(`\\${path.sep}node_modules\\${path.sep}`))) {
7979
const p = path.join(packages[match].root, request.substr(match.length));
8080
return oldLoad.call(this, p, parent);
8181
} else {
82-
try {
83-
if (isAngularProject) {
84-
return oldLoad.call(this, resolve.sync(request, { basedir: process.cwd() }), parent);
85-
}
86-
} catch (e) {
87-
// Do nothing. Fallback to the old method.
88-
}
82+
// try {
83+
// if (isAngularProject) {
84+
// return oldLoad.call(this, resolve.sync(request, { basedir: process.cwd() }), parent);
85+
// }
86+
// } catch (e) {
87+
// // Do nothing. Fallback to the old method.
88+
// }
8989

9090
return oldLoad.apply(this, arguments);
9191
}

0 commit comments

Comments
 (0)