How to use SASS/SCSS with Laravel Vite

Leave a Comment

Step 1:


npm add -D sass

# OR

yarn add sass -D
Bash

Step 2:

Update the `vite.config.js` file like this.

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.scss',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
});

Step 3:

Update the layout file.

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

0 comments:

Post a Comment