import { RouteRecordRaw, createRouter, createWebHashHistory, createWebHistory } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
	{
		path: '/',
		name: 'layout',
		component: () => import(/* webpackChunkName: "layout" */ '@/views/layout.vue'),
	},
];

/**
 * 如果需要打包成app，则要将路由改为Hash路由，createWebHashHistory
 * 如果不需要 createWebHistory
 */
const router = createRouter({
	history:
		process.env.NODE_ENV === 'production' ? createWebHashHistory(process.env.BASE_URL) : createWebHistory(process.env.BASE_URL),
	routes,
});

export default router;
