Closed timacdonald closed 9 months ago
This PR is an alternative to https://github.com/laravel/vite-plugin/pull/252 and https://github.com/laravel/vite-plugin/pull/259.
It allows the path to be a string (current behaviour) or an array (new behaviour).
path
This enables two features:
./Pages/Whoops.vue
createInertiaApp({ // ... resolve: (name) => resolvePageComponent([`./Pages/${name}.vue`, './Pages/Whoops.vue'], import.meta.glob('./Pages/**/*.vue')), });
Of course, if the fallback isn't present things can still go wrong.
.jsx
.tsx
createInertiaApp({ // ... resolve: (name) => resolvePageComponent([`./Pages/${name}.tsx`, `./Pages/${name}.jsx`], import.meta.glob('./Pages/**/*.[tj]sx')), });
@timacdonald Now that I see yours, it's indeed a better solution than mine
This PR is an alternative to https://github.com/laravel/vite-plugin/pull/252 and https://github.com/laravel/vite-plugin/pull/259.
It allows the
path
to be a string (current behaviour) or an array (new behaviour).This enables two features:
./Pages/Whoops.vue
is the fallback:Of course, if the fallback isn't present things can still go wrong.
.jsx
to.tsx