生产环境部署的时候直接打包成一个 js 文件了吧, 直接放到站点的 public 目录或者 cdn 上
开发的时候, 官方的建议就是你想的那样, webpack-dev-server 和本来的后端 server 各起一个
You may want to run a backend server or a mock of it in development. You should not use the webpack-dev-server as a backend. Its only purpose is to serve static (webpacked) assets.
You can run two servers side-by-side: The webpack-dev-server and your backend server.
ref:
https://webpack.github.io/docs/webpack-dev-server.html#combining-with-an-existing-server