[Vuejs]-Laravel webpack vue code splitting lazy routes are not versioned

0👍

as you are using Vue Router so you should use Dynamic Imports like this


export default [
    {
        path: '/users',
        name: 'users',
        component: () => import('@/pages/users/index'),
        meta: {
            auth: true,
            admin: true,
        }
    },
    {
        path: '/show/:id',
        name: 'users.show',
        component: import('@/pages/users/show'),
        meta: {
            auth: true,
            admin: true,
        }
    },
];

ref link https://laravel-news.com/using-dynamic-imports-with-laravel-mix

Leave a comment