import VueRouter from "vue-router"
import type { RouteConfig } from "vue-router"

const requirePages = require.context("./", true, /index.vue$/);

const routes: RouteConfig[] = [
	...requirePages.keys().map(path => {
		const [, pagePath] = path.match(/\.(.+)index.vue/);
		
		return { path: pagePath, component: requirePages(path).default };
	})
];	

export default new VueRouter({ routes })