New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

How do I compile sass to css with webpack?

Dan Farrell August 25, 2020 by Dan Farrell

Hi. I'm just getting started with V3 but i'm struggling to know how to compile my .sass files into .css files with Webpack (this is completely new to me).

I notice there is a webpack.mix.js file but I don't understand how I change/remove the postCss mix to be a Sass/Scss mix compiler instead. I have looked into webpack loaders, but the examples shown in the docs there do not look like the default code found in webpack.mix.js and I am confused on how I modify this code correctly?

Any guidance or helpful explanations on what I need to do would be greatly appreciated. Thanks!

mix.postCss('resources/css/tailwind.css', 'public/css', [
    require('postcss-import'),
    require('tailwindcss'),
    require('postcss-nested'),
    require('postcss-preset-env')({stage: 0})
])
Answered by Dan Farrell!
>>>>>>> Answered <<<<<<<
3 Replies
3 Followers