content: import React from 'react';
  import { Router, browserHistory } from 'react-router';
  import { App } from 'components';
  
  function errorLoading(err) {
    console.error('Dynamic page loading failed', err);
  }
  
  function loadRoute(cb) {
    return (module) => cb(null, module.default);
  }
  
  const routes = {
    path: '/',
    component: App,
    indexRoute: {
      getComponent(location, cb) {
        System.import('components/Home/Home')
          .then(loadRoute(cb))
          .catch(errorLoading);
      }
    },
    childRoutes: [
      {
        path: 'videos',
        getComponent(location, cb) {
          System.import('containers/VideosPage/VideosPage')
            .then(loadRoute(cb))
            .catch(errorLoading);
        }
      },
      {
        path: 'stats',
        getComponent(location, cb) {
          System.import('containers/StatsPage/StatsPage')
            .then(loadRoute(cb))
            .catch(errorLoading);
        }
      },
      {
        path: '*', // fallback to <Home /> if the route isn't found
        getComponent(location, cb) {
          System.import('components/Home/Home')
            .then(loadRoute(cb))
            .catch(errorLoading);
        }
      }
    ]
  };
  
  export default () => <Router history={browserHistory} routes={routes} />;
  