react-hot-loader and webpack

70 Views Asked by At

I am new in stackoverflow and I am junior in React I have a question I installed webpack V5 and then I try to install react-hot-loader. This is webpack.config.js

`

const path = require ("path");
const webpack = require ("webpack");

module.exports = {
    module :{
        entry: './src/index.js',
  output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist')
  },
        rules: [
            {
              test: /\.(png|jpg|gif)$/i,
             dependency: { not: ['url'] },
              use: [
                {
                  loader: 'url-loader',
                  options: {
                    limit: 8192,
                  },
                },
              ],
            },
        ],
    },
    resolve :{extensions : ["*" , ".js" , ".jsx"]},
    devServer: {
        // contentBase
        static : {
          directory : path.join(__dirname, "public/")
        },
        port: 3000,
        // publicPath
        devMiddleware:{
           publicPath: "https://localhost:3000/dist/",
        }
        
      },
};

`

I want to install React-hot-loader but it does`nt install and I have error

0

There are 0 best solutions below