I want to have separate app.js files one for the frontend and the other for the admin panel; where I have two views app.blade.php and admin.blade.php. How can I configure Vite to compile admin components in admin.js and the frontend in app.js? I'm using Inertia with Vuejs
Create an admin.js under resources/js, and add all your admin-related JavaScript there. Then add that to the input array in your Vite config, vite.config.js.
@ahmedsobhy why do you need to split it up? Inertia already does code splitting so each page only needs the components it needs. And you can use just 1 view for both. The page is rendered by vue anyways
@thinkverse I want to separate all admin things; so I use a second view because of ziggy to separate admin routes and I want to have "admin.js" which on the server wouldn't be publicly accessible
@Sinnbeck What I was thinking is to create admin.js and have its components with it but they won't be in the public folder, they'll be served by a controller maybe from the resources/public .. so I'm asking if it is possible to make Vite compile the admin.js and its components separately and save them in resources/public not the public folder?
@ahmedsobhy not quite sure why that is necessary. But be aware that you would be forced to disable code splitting in vite to have just one huge file for admin