@angular/compiler-cli
Advanced tools
Comparing version
{ | ||
"name": "@angular/compiler-cli", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"description": "Angular - the compiler CLI for Node.js", | ||
@@ -18,4 +18,4 @@ "main": "index.js", | ||
"typescript": "^2.0.2", | ||
"@angular/compiler": "2.4.2", | ||
"@angular/core": "2.4.2" | ||
"@angular/compiler": "2.4.3", | ||
"@angular/core": "2.4.3" | ||
}, | ||
@@ -22,0 +22,0 @@ "repository": { |
@@ -50,19 +50,21 @@ /** | ||
// List loadChildren of this single module. | ||
var staticSymbol = reflector.findDeclaration(modulePath, className, containingFile); | ||
var appStaticSymbol = reflector.findDeclaration(modulePath, className, containingFile); | ||
var ROUTES = reflector.findDeclaration(ROUTER_MODULE_PATH, ROUTER_ROUTES_SYMBOL_NAME); | ||
var lazyRoutes = _extractLazyRoutesFromStaticModule(staticSymbol, reflector, host, ROUTES); | ||
var routes = {}; | ||
lazyRoutes.forEach(function (lazyRoute) { | ||
var lazyRoutes = _extractLazyRoutesFromStaticModule(appStaticSymbol, reflector, host, ROUTES); | ||
var allLazyRoutes = lazyRoutes.reduce(function includeLazyRouteAndSubRoutes(allRoutes, lazyRoute) { | ||
var route = lazyRoute.routeDef.toString(); | ||
_assertRoute(routes, lazyRoute); | ||
routes[route] = lazyRoute; | ||
_assertRoute(allRoutes, lazyRoute); | ||
allRoutes[route] = lazyRoute; | ||
// StaticReflector does not support discovering annotations like `NgModule` on default | ||
// exports | ||
// Which means: if a default export NgModule was lazy-loaded, we can discover it, but, | ||
// we cannot parse its routes to see if they have loadChildren or not. | ||
if (!lazyRoute.routeDef.className) { | ||
return allRoutes; | ||
} | ||
var lazyModuleSymbol = reflector.findDeclaration(lazyRoute.absoluteFilePath, lazyRoute.routeDef.className || 'default'); | ||
var subRoutes = _extractLazyRoutesFromStaticModule(lazyModuleSymbol, reflector, host, ROUTES); | ||
// Populate the map using the routes we just found. | ||
subRoutes.forEach(function (subRoute) { | ||
_assertRoute(routes, subRoute); | ||
routes[subRoute.routeDef.toString()] = subRoute; | ||
}); | ||
}); | ||
return routes; | ||
return subRoutes.reduce(includeLazyRouteAndSubRoutes, allRoutes); | ||
}, {}); | ||
return allLazyRoutes; | ||
} | ||
@@ -154,3 +156,3 @@ exports.listLazyRoutesOfModule = listLazyRoutesOfModule; | ||
return routes.reduce(function (m, r) { | ||
if (r.loadChildren) { | ||
if (r.loadChildren && typeof r.loadChildren === 'string') { | ||
return m.concat(r.loadChildren); | ||
@@ -157,0 +159,0 @@ } |
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
exports.VERSION = new core_1.Version('2.4.2'); | ||
exports.VERSION = new core_1.Version('2.4.3'); | ||
//# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["2.4.2"]}}},{"__symbolic":"module","version":1,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["2.4.2"]}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["2.4.3"]}}},{"__symbolic":"module","version":1,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["2.4.3"]}}}] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
140151
0.65%1238
0.16%