I recently created a Vue3 vite project, following the given instructions. However, I noticed that the method I used did not generate any env.development or env.production files, leaving me with little context when referring to the documentation. I assume that there should be something included in those files, but what exactly?
Although the project compiles successfully, it encounters an error with the router setup as shown below:
import { createWebHistory, createRouter, RouteRecordRaw } from "vue-router";
const history = createWebHistory();
const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "Appointments",
component: () => import("../views/Appointments.vue"),
},
{
path: "/pets",
name: "Appointments",
component: () => import("../views/Pets.vue"),
},
{
path: "/Claims",
name: "Claims",
component: () => import("../views/Claims.vue"),
},
];
const router = createRouter({
//fails on this line:
history: createWebHistory(process.env.BASE_URL),
routes,
});
export default router;
I am struggling to figure out how to set the base URL correctly. Any suggestions?