0

I am setting webpack but I have an error. It happens when I try to use html-loader, what I do when I set rules in the module in webpack.config.js file. It says there is an error in child compilation. I am trying to understand why.

Here is the error :

ERROR in child compilations (Use 'stats.children: true' resp.'-- 
     stats-children' for more details)

Here is the code (thank you for your help) :

module.exports = {
  mode: "development",
  entry: path.resolve(__dirname, './src/index.js'),
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'main.js',
  },
  module: {
    rules: [
      {
        test: /\.html$/i,
        use: [
          {
            loader: "html-loader",
            options:{
              minimize: true,
            },
          },
        ],
      },
    ],
  },
  plugins: [new HtmlWebpackPlugin({
      template: path.resolve(__dirname, './src/index.html'),
      filename: "index.html",
    })],
};

My files and folders

MORÈ
  • 2,480
  • 3
  • 16
  • 23
Emilie Tossan
  • 127
  • 1
  • 1
  • 16

1 Answers1

0

In order to solve this warning you just need to add stats.children: true in your webpack.mix.js file. First of all open your webpack.mix.js file and add the following code.

mix.webpackConfig({
    stats: {
        children: true,
    },
});
maximus383
  • 584
  • 8
  • 25
  • Thank you Maximus. Sadly I don't have webpack.mix.js file. Where should I create one ? These are my files and folders : https://i.stack.imgur.com/u6UAC.png – Emilie Tossan May 17 '22 at 14:27
  • Dude, he's just using a webpack.config file not laravel-mix package which is used in laravel. Please learn how to read sir. – TheBAST Nov 24 '22 at 05:47