I currently have a Vue application set up locally, where the main /index.html
serves as the webroot. However, when I deploy the application, I would like the subfolder /stats
to be considered the root (and ensure that all my routes still function correctly).
Is there a way to achieve this without having to manually modify my router/index.js?
vue.config.js
// I have tried the following configuration, but it doesn't seem to work
module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "/stats/" : "/",
};
router.js
const routes = [
{
path: "/",
name: "HomeView",
component: HomeView,
},
{
path: "/grid",
name: "GridView",
component: GridView,
},
...
]