[Fixed] Laravel 10 Include CSS & JS with Vite

This article asnwer for:

  • Laravel 10 Include CSS & JS with Vite
  • how to include external css and js file in laravel 10
  • how to include css file in laravel 10
  • laravel css and js not working
  • How to include CSS and js files in Laravel?

I’m answering thise all of query.

Vite in Laravel 10 already install to your system and it’s the pwerful, you don’t need to do anything, it’s too much ever in Laravel, Now Laravel Mix is not available in laravel 10 and it’s good.

It’s the batter option to get bydefault Vite in Laravel, just after installing Laravel 10 then you can use CSS and JS with Vite

Vite is the new technology, you don’t need to worry about it and not need to learn now.

Insted of use {{asset(‘admin/css’)}} you can use vite simple directive

Just follow the Laravel 10 Include CSS & JS with Vite

@vite([ 'resources/backend/assets/vendor/fonts/boxicons.css',
        'resources/backend/assets/vendor/css/core.css',
        'resources/backend/assets/vendor/css/theme-default.css',
        'resources/backend/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css',      
        'resources/backend/assets/js/config.js',

        ])
  @vite(['resources/css/app.css', 'resources/js/app.js'])

Laravel 10 Display Image in Blade File

Leave a Reply