function importRoutes() {
  const routeFiles = import.meta.glob("/**/*.routes.js", { eager: true });
  const routes = [];
  for (const path in routeFiles) {
    if (Object.prototype.hasOwnProperty.call(routeFiles, path)) {
      const routeModule = routeFiles[path];
      const routeConfig = routeModule.default || routeModule;
      routes.push(routeConfig);
    }
  }
  return routes;
}

export default importRoutes;
