15

webpack-servehttps ://github.com/webpack-contrib/webpack-serve

webpack-dev-serverhttps ://github.com/webpack/webpack-dev-server

他们都说他们是 webpack 的开发服务器。它们有何不同?

4

2 回答 2

21
+-----------------+--------------------------+----------------------+
|                 |    webpack-dev-server    |    webpack-serve     |
+-----------------+--------------------------+----------------------+
| Initial release | 23 Dec 2014              | 12 feb 2018          |
| Total releases  | 74                       | 7                    |
| Github stars    | 3449                     | 231                  |
| Lines of code   | 28301                    | 16075                |
| under the hood  | Express.js (22047 lines) | Koa.js (8913 lines)| |
| API             | not aligned              | API first            |
| Mode            | active (support, update) | deprecated (mar 2018)|
| Total           | work slower but supports | fast alternative     |
|                 |   old browsers           |                      |
+-----------------+--------------------------+----------------------+

来源

https://www.reddit.com/r/javascript/comments/7pg2rq/webpackdevserver_is_now_in_maintenance_mode/dsgwxjd/?st=jf286v37&sh=0336089c

于 2018-03-22T07:26:09.407 回答
1

我没有使用过 webpack-serve,但通过查看文档,初步认为它是相对较新的 repo(针对 webpack-dev-server 70+ 发布了 7 个版本),重点是使用浏览器本机 WebSocket 来获取资产而不是轮询机制。我的猜测是,这显然会使 webpack-serve 在开发模式下工作时比 webpack-dev-server 更好更快地工作。

这不禁让人好奇。我会在我目前的设置上试一试,并会尝试返回结果。

于 2018-03-22T07:23:37.417 回答