You can use either Vite or Webpack for that, personally I would go with Vite because its much faster and also the default for Laravel now.
But if you prefer to work with Webpack that's still possible, in the end its personal preference.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am seeking assistance with integrating the Bootstrap AdminLTE template or another backend template. Additionally, I'd like to incorporate a different template for the frontend, utilizing Bootstrap and jQuery with separate CSS and JS files. Specifically, I aim to include only admin.css and admin.js in my layout. Should I opt for Vite, or is Webpack a better choice? I appreciate any guidance through this process.
Thank you.
Import your js files directly to bootstrap.js, by default bootstrap.js should already be imported in app.js You can also import the files directly to app.js, but I prefer to import those files in bootstrap.js for a cleaner setup
If you look in the vite config you'll see that app.js is already added to the build input
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
});
For css you can import your css files in app.css because as you can see in the above example by default app.css is also already added to the input.
If you want you can also add files directly to the input instead of adding them via bootstrap.js/app.js or app.css files. As you can see in the example below, I added admin.css.
input: [
'resources/css/app.css',
'resources/css/admin.css',
'resources/js/app.js',
],
But personally I rarely do that, I mostly add files to app.css and bootstrap.js/app.js
Please or to participate in this conversation.