M
M
Maxim Pritchin2021-01-25 22:06:00
Laravel
Maxim Pritchin, 2021-01-25 22:06:00

How to merge in laravel 8 postcss tailwind scss?

How to merge in laravel 8 postcss tailwind scss?

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/css/app.scss', 'resources/css/app.css')
    .postCss('resources/css/app.css', 'public/css', [
        require('postcss-import'),
        require('tailwindcss'),
        require('autoprefixer'),
    ]);

if (mix.inProduction()) {
    mix.version();
}

I tried to do this, but the styles that are needed from Scss files are not loaded

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
apotheosis91, 2021-02-04
@apotheosis91

Can use laravel-mix-tailwind

// webpack.mix.js

const mix = require('laravel-mix');
require('laravel-mix-tailwind');

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .tailwind();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question