text: import { App } from '../features/home';
  import { PageNotFound } from '../features/common';
  import homeRoute from '../features/home/route';
  import commonRoute from '../features/common/route';
  import timelineRoute from '../features/timeline/route';
  import profileRoute from '../features/profile/route';
  import aboutRoute from '../features/about/route';
  import libraryRoute from '../features/library/route';
  import goalDiscoveryRoute from '../features/goal-discovery/route';
  
  // NOTE: DO NOT CHANGE the 'childRoutes' name and the declaration pattern.
  // This is used for Rekit cmds to register routes config for new features, and remove config when remove features, etc.
  const childRoutes = [
    homeRoute,
    commonRoute,
    timelineRoute,
    profileRoute,
    aboutRoute,
    libraryRoute,
    goalDiscoveryRoute,
  ];
  
  const routes = [{
    path: '/',
    component: App,
    childRoutes: [
      ...childRoutes,
      { path: '*', name: 'Page not found', component: PageNotFound },
    ].filter(r => r.component || (r.childRoutes && r.childRoutes.length > 0)),
  }];
  
  // Handle isIndex property of route config:
  //  Dupicate it and put it as the first route rule.
  function handleIndexRoute(route) {
    if (!route.childRoutes || !route.childRoutes.length) {
      return;
    }
  
    const indexRoute = route.childRoutes.find(child => child.isIndex);
    if (indexRoute) {
      const first = { ...indexRoute };
      first.path = '';
      first.exact = true;
      first.autoIndexRoute = true; // mark it so that the simple nav won't show it.
      route.childRoutes.unshift(first);
    }
    route.childRoutes.forEach(handleIndexRoute);
  }
  
  routes.forEach(handleIndexRoute);
  export default routes;
  