index.js 254 B

123456789
  1. const path = require('path')
  2. const files = require.context('./', false, /\.vue$/)
  3. const modules = {}
  4. files.keys().forEach(key => {
  5. const name = path.basename(key, '.vue')
  6. modules[name] = files(key).default || files(key)
  7. })
  8. export default modules