我无法让webpack dev服务器工作 . 我的应用程序结构如下 . 在 src 目录里面我有两个目录,一个 server 和一个 client . 我通过在localhost:3000上运行来启动服务器,并通过运行webpack来启动客户端,这使得 dist 文件夹在客户端目录中 . 我怎样才能解决这个问题?

File structure

enter image description here

server/index.js

app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'ejs')
app.use(Express.static(path.join(__dirname, '../', 'client')))
...
app.listen(3000, function () {
  console.log('Express server is up on port 3000')
})

server/views/index.ejs

<body>
  <h1>EJS Static</h1>
  <div id="app"></div>
  <script src="dist/bundle.js"></script>
</body>

webpack.config.babel.js

import path from 'path'
const publicPath = path.resolve(__dirname, './src/client')

context: publicPath,
  entry: {
    bundle: [
      'webpack-dev-server/client?http://localhost:8080',
      'webpack/hot/only-dev-server',
      'script-loader!jquery/dist/jquery.min.js',
      'script-loader!tether/dist/js/tether.min.js',
      'script-loader!bootstrap/dist/js/bootstrap.min.js',
      './app.js'
    ]
  },
  output: {
    path: path.join(publicPath, 'dist'),
    filename: '[name].js',
    publicPath: '/dist/'
  },

   plugins: [
    ...
    new webpack.HotModuleReplacementPlugin()
  ],
  devServer: {
    contentBase: path.join(publicPath, '/dist')
  }

package.json

"scripts": {
...
"serve": "webpack-dev-server",
}