Have you tried:
import.meta.glob('./**/*.vue', { eager: true })
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I may have a strange question, but I have it.
I'm using InertiaJS and a modular structure (laravel-modules from nWidart) and VITE is in one of the main modules. Now I'm faced with a problem: if I try to render a page in another module, "Inertia" always goes along the path of the main module.
Example: Example: Here is VITE and the main module with vue components:
/Modules/GeneralModule/vite.config.js
/Modules/GeneralModule/Resources/js/app.js
/Modules/GeneralModule/Resources/js/Pages/MyModule1.vue
But some components are located in other modules. I don't understand how to access them.
/Modules/SecondModule/Resources/js/Pages/MyModule2.vue
Which path in the controller should be specified in order to access components from another module?
return Inertia::render('MyModule2.vue', $template->complete());
Part of the app.js code which is located in /Modules/GeneralModule/Resources/js/app.js
createInertiaApp({
resolve: (name) => resolvePageComponent(
`./Pages/${name}.vue`, import.meta.glob('./**/*.vue')
)
});
Please or to participate in this conversation.