webpack-serve
:https ://github.com/webpack-contrib/webpack-serve
webpack-dev-server
:https ://github.com/webpack/webpack-dev-server
他们都说他们是 webpack 的开发服务器。它们有何不同?
webpack-serve
:https ://github.com/webpack-contrib/webpack-serve
webpack-dev-server
:https ://github.com/webpack/webpack-dev-server
他们都说他们是 webpack 的开发服务器。它们有何不同?
+-----------------+--------------------------+----------------------+
| | 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 | |
+-----------------+--------------------------+----------------------+
来源
我没有使用过 webpack-serve,但通过查看文档,初步认为它是相对较新的 repo(针对 webpack-dev-server 70+ 发布了 7 个版本),重点是使用浏览器本机 WebSocket 来获取资产而不是轮询机制。我的猜测是,这显然会使 webpack-serve 在开发模式下工作时比 webpack-dev-server 更好更快地工作。
这不禁让人好奇。我会在我目前的设置上试一试,并会尝试返回结果。