@eui/tools 6.12.50 → 6.12.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -294,9 +294,22 @@ const getProjectRoutes = (project, routesDefs) => {
294
294
  // those files are also generated based on the route "lazyDefs" data definition
295
295
 
296
296
  if (route.lazy) {
297
- const scopeName = defRoute.lazyLoadDef.npmPkg.split('/')[0].substr(1);
298
- const pkgName = defRoute.lazyLoadDef.npmPkg.split('/')[1];
299
- const lazyFeatureLibName = `${scopeName}-${pkgName}-${defRoute.lazyLoadDef.moduleName}.lib.module`;
297
+ let lazyLoadDef = null;
298
+
299
+ if (Array.isArray(defRoute.lazyLoadDef)) {
300
+ lazyLoadDef = defRoute.lazyLoadDef.filter(lld => lld.euiVersion === euiVersion)[0];
301
+ } else {
302
+ lazyLoadDef = defRoute.lazyLoadDef;
303
+ }
304
+
305
+ if (!lazyLoadDef) {
306
+ console.log(`Unable to find lazyLoadDef route for path : ${defRoute.path}`);
307
+ throw new Error('LAZY_ROUTE_DEF_NOT_FOUND');
308
+ }
309
+
310
+ const scopeName = lazyLoadDef.npmPkg.split('/')[0].substr(1);
311
+ const pkgName = lazyLoadDef.npmPkg.split('/')[1];
312
+ const lazyFeatureLibName = `${scopeName}-${pkgName}-${lazyLoadDef.moduleName}.lib.module`;
300
313
 
301
314
  if (euiVersion === '10.x') {
302
315
  loadChildrenGenerated = `loadChildren: "./features/${lazyFeatureLibName}#Module"`;
@@ -306,8 +319,8 @@ const getProjectRoutes = (project, routesDefs) => {
306
319
 
307
320
  lazyLibDef = {
308
321
  filename: `${lazyFeatureLibName}.ts`,
309
- npmPkg: defRoute.lazyLoadDef.npmPkg,
310
- moduleName: defRoute.lazyLoadDef.moduleName,
322
+ npmPkg: lazyLoadDef.npmPkg,
323
+ moduleName: lazyLoadDef.moduleName,
311
324
  };
312
325
 
313
326
  // if the route is a remote, the elementLoader is then used as a default feature module loaded