lib/app/store.js
function getModule (filename) {
  const file = files(filename)
  const module = file.default || file
  if (module.commit) {
    throw new Error('[vssr] <%= dir.store %>/' + filename.replace('./', '') + ' should export a method which returns a Vuex instance.')
  }
  if (module.state && typeof module.state !== 'function') {
    throw new Error('[vssr] state should be a function in <%= dir.store %>/' + filename.replace('./', ''))
  }
  return module
}
function getModule (filename) {
  const file = files(filename)
  const module = file.default || file
  if (module.commit) {
    throw new Error('[vssr] <%= dir.store %>/' + filename.replace('./', '') + ' should export a method which returns a Vuex instance.')
  }
  if (module.state && typeof module.state !== 'function') {
    throw new Error('[vssr] state should be a function in <%= dir.store %>/' + filename.replace('./', ''))
  }
  return module
}
function getModule ( filename ) { const file = files ( filename ) const module = file . default || file if ( module . commit ) { throw new Error ( '[vssr] <%= dir.store %>/' + filename . replace ( './' , '' ) + ' should export a method which returns a Vuex instance.' ) } if ( module . state && typeof module . state !== 'function' ) { throw new Error ( '[vssr] state should be a function in <%= dir.store %>/' + filename . replace ( './' , '' ) ) } return module }
Dynamically require module
Dynamically require module