function getRoute(path, subComponentName) {
  return {
    path: path,
    subComponentName: subComponentName,
    onEnter() {
      require('../../networking/auth')
    },
    getComponents(location, cb) {
      // require.ensure([], (require) => {
      cb(null, require('../../components/views/OnboardingView'))
      // })
    },
  }
}

export default {
  path: 'onboarding',
  getChildRoutes(location, cb) {
    // require.ensure([], () => {
    cb(null, [
      getRoute('communities', 'CommunityPicker'),
      getRoute('awesome-people', 'PeoplePicker'),
      getRoute('profile-header', 'CoverPicker'),
      getRoute('profile-avatar', 'AvatarPicker'),
      getRoute('profile-bio', 'InfoPicker'),
    ])
    // })
  },
}


function getRoute(path, subComponentName) {
  return {
    path: path,
    subComponentName: subComponentName,
    getComponents(location, cb) {
      // require.ensure([], (require) => {
      cb(null, require('../../components/views/OnboardingView'))
      // })
    },
  }
}

export default {
  path: 'onboarding',
  getChildRoutes(location, cb) {
    // require.ensure([], () => {
    cb(null, [
      getRoute('communities', 'CommunityPicker'),
      getRoute('awesome-people', 'PeoplePicker'),
      getRoute('profile-header', 'CoverPicker'),
      getRoute('profile-avatar', 'AvatarPicker'),
      getRoute('profile-bio', 'InfoPicker'),
    ])
    // })
  },
}


Remove the require of auth in onboarding routes.
Remove the require of auth in onboarding routes.