The problem of entry Array input in webpack

entry: [
    // webpack-dev-server8080
    "webpack-dev-server/client?http://localhost:8080",

    // "only-dev-server""only-"
    "webpack/hot/only-dev-server",

    // webpackwebpack-dev-server
    "./webpack.entry.js"
  ],

when I want to configure the code like this, npm run dev (webpack-dev-server) instead, I reported an error, but I wrote it as
below so that it can be compiled successfully. Why does the tutorial need to configure so many things above for entry? is it OK if you don"t have to configure it? Can"t you start the local service by writing dev:webpack-dev-server in the scripts in package.json

entry:{
        bundle : __dirname + "/src/index.js"   
    }
Mar.01,2021

1. Your first way of writing is wrong because you don't have . / webpack.entry.js locally, change it to _ _ dirname +'/ src/index.js'

.
Menu