0

Here is the webpack.config.js

module: {
    rules: [
        {
            // LESS-CSS Loader
            test: /\.(le|c)ss$/,
            use: [
                {
                    loader: MiniCssExtractPlugin.loader,
                },
                require.resolve('css-loader'),
                require.resolve('less-loader')
            ]
        }
    ]
}

The css files will also be processed by less loader so will it cause an overhead? I just want to know that will the existing approach cause any overhead or it doesn't have any impact on performance.

Nishant
  • 1,034
  • 9
  • 19

1 Answers1

0

if you want to apply those loaders for less files only then change your test to test: /\.less$/, it still requires both less and css loader for that, then add another loader for css specific only

 {
   test: /\.css$/,
   use: require.resolve('css-loader')
 }
Lelouch
  • 910
  • 6
  • 19
  • I understand that I can split CSS test from it. I just want to know that will the existing approach cause any overhead or it doesn't have any impact on performance – Nishant Sep 23 '19 at 05:36
  • probably might add a little build time, because it will have to go through less and css loaders despite reading css files only but should expect correct output anyway. – Lelouch Sep 23 '19 at 05:39