[Vuejs]-How to compile module scss in vue component? (laravel-mix)

0👍

At the moment, I made the modular scss work, but regular scss has stopped working. “scoped” – including.

webpack.mix.js

mix.extend('rewriteRules', webpackConfig => {
let scssRule = webpackConfig.module.rules.find(rule => String(rule.test) === '/\\.scss$/');

scssRule.loaders[1] = { /* css-loader */
    loader: 'css-loader',
    options: {
        modules: true,
        importLoaders: 1,
        localIdentName: '[name]_[local]_[hash:base64:4]'
    }
};
});

mix.rewriteRules();

If someone helps restore the operation of a non-modular sass, I would be grateful.

Leave a comment