Skip to content

Commit 57e0c88

Browse files
Merge pull request #57 from angular/master
Update upstream
2 parents 2751de1 + 19bbc7f commit 57e0c88

File tree

9 files changed

+5940
-17
lines changed

9 files changed

+5940
-17
lines changed

package-lock.json

Lines changed: 5885 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"typescript": "~2.3.1",
9898
"url-loader": "^0.5.7",
9999
"walk-sync": "^0.3.1",
100-
"webpack": "~3.1.0",
100+
"webpack": "~3.2.0",
101101
"webpack-dev-middleware": "^1.11.0",
102102
"webpack-dev-server": "~2.5.1",
103103
"webpack-merge": "^2.4.0",

packages/@angular/cli/blueprints/ng/files/angular-cli.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@
3636
},
3737
"lint": [
3838
{
39-
"project": "<%= sourceDir %>/tsconfig.app.json"
39+
"project": "<%= sourceDir %>/tsconfig.app.json",
40+
"exclude": "**/node_modules/**"
4041
},
4142
{
42-
"project": "<%= sourceDir %>/tsconfig.spec.json"
43+
"project": "<%= sourceDir %>/tsconfig.spec.json",
44+
"exclude": "**/node_modules/**"
4345
},
4446
{
45-
"project": "e2e/tsconfig.e2e.json"
47+
"project": "e2e/tsconfig.e2e.json",
48+
"exclude": "**/node_modules/**"
4649
}
4750
],
4851
"test": {

packages/@angular/cli/models/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
3232
const projectConfig = CliConfig.fromProject();
3333
if (projectConfig) {
3434
value = projectConfig.get(jsonPath);
35-
} else {
35+
} else if (CliConfig.globalConfigFilePath() !== CliConfig.configFilePath()) {
3636
const globalConfig = CliConfig.fromGlobal();
3737
if (globalConfig) {
3838
value = globalConfig.get(jsonPath);

packages/@angular/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"typescript": ">=2.0.0 <2.4.0",
8383
"url-loader": "^0.5.7",
8484
"walk-sync": "^0.3.1",
85-
"webpack": "~3.1.0",
85+
"webpack": "~3.2.0",
8686
"webpack-dev-middleware": "^1.11.0",
8787
"webpack-dev-server": "~2.4.5",
8888
"webpack-merge": "^2.4.0",

packages/@ngtools/webpack/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let version;
77
try {
88
version = require('@angular/compiler-cli').VERSION;
99
} catch (e) {
10-
throw new Error('The "@angular/compiler-cli" package was not properly installed.');
10+
throw new Error('The "@angular/compiler-cli" package was not properly installed. Error: ' + e);
1111
}
1212

1313
// Check that Angular is also not part of this module's node_modules (it should be the project's).

packages/@ngtools/webpack/src/plugin.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,25 @@ export class AotPlugin implements Tapable {
259259
return result;
260260
}
261261

262+
private _getLazyRoutesFromNgtools() {
263+
try {
264+
return __NGTOOLS_PRIVATE_API_2.listLazyRoutes({
265+
program: this._program,
266+
host: this._compilerHost,
267+
angularCompilerOptions: this._angularCompilerOptions,
268+
entryModule: this._entryModule
269+
});
270+
} catch (err) {
271+
// We silence the error that the @angular/router could not be found. In that case, there is
272+
// basically no route supported by the app itself.
273+
if (err.message.startsWith('Could not resolve module @angular/router')) {
274+
return {};
275+
} else {
276+
throw err;
277+
}
278+
}
279+
}
280+
262281
// registration hook for webpack plugin
263282
apply(compiler: any) {
264283
this._compiler = compiler;
@@ -491,13 +510,8 @@ export class AotPlugin implements Tapable {
491510
.then(() => {
492511
// We need to run the `listLazyRoutes` the first time because it also navigates libraries
493512
// and other things that we might miss using the findLazyRoutesInAst.
494-
let discoveredLazyRoutes: LazyRouteMap = this.firstRun ?
495-
__NGTOOLS_PRIVATE_API_2.listLazyRoutes({
496-
program: this._program,
497-
host: this._compilerHost,
498-
angularCompilerOptions: this._angularCompilerOptions,
499-
entryModule: this._entryModule
500-
})
513+
let discoveredLazyRoutes: LazyRouteMap = this.firstRun
514+
? this._getLazyRoutesFromNgtools()
501515
: this._findLazyRoutesInAst();
502516

503517
// Process the lazy routes discovered.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {ng} from '../../utils/process';
2+
import {expectFileToExist, moveFile} from '../../utils/fs';
3+
import {updateJsonFile} from '../../utils/project';
4+
import {getGlobalVariable} from '../../utils/env';
5+
import * as path from 'path';
6+
7+
8+
export default function() {
9+
// Skip this in Appveyor tests.
10+
if (getGlobalVariable('argv').appveyor) {
11+
return Promise.resolve();
12+
}
13+
14+
const tmp = getGlobalVariable('tmp-root');
15+
16+
return Promise.resolve()
17+
.then(() => moveFile('node_modules/@angular/router', path.join(tmp, '@angular-router.backup')))
18+
.then(() => ng('build'))
19+
.then(() => expectFileToExist('./dist/index.html'))
20+
.then(() => moveFile(path.join(tmp, '@angular-router.backup'), 'node_modules/@angular/router'));
21+
}

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5480,9 +5480,9 @@ webpack-sources@^1.0.1:
54805480
source-list-map "^2.0.0"
54815481
source-map "~0.5.3"
54825482

5483-
webpack@~3.1.0:
5484-
version "3.1.0"
5485-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.1.0.tgz#ac0675e500db835f9ab2369d29ba096f51ad0731"
5483+
webpack@~3.2.0:
5484+
version "3.2.0"
5485+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.2.0.tgz#8b0cae0e1a9fd76bfbf0eab61a8c2ada848c312f"
54865486
dependencies:
54875487
acorn "^5.0.0"
54885488
acorn-dynamic-import "^2.0.0"

0 commit comments

Comments
 (0)