index.js 229 B

12345678910
  1. const files = import.meta.glob('./*.js', { eager: true });
  2. let api = {};
  3. Object.keys(files).forEach((key) => {
  4. api = {
  5. ...api,
  6. [key.replace(/(.*\/)*([^.]+).*/gi, '$2')]: files[key].default,
  7. };
  8. });
  9. export default api;