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

const scssFiles = glob.sync('themes/**/*.scss');
scssFiles.forEach(file => {
    const outputFilename = path.basename(file, '.scss') + '.min.css';

    mix.sass(file, path.dirname(file), {
        implementation: require('sass')
    })
    .options({
        processCssUrls: false, // Optional: Disable URL rewriting if needed
    })
    .webpackConfig({
        output: {
            chunkFilename: outputFilename
        }
    });
});