You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
229 B

7 months ago
  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;