使用之间有什么区别
webpack --watch
和
webpack-dev-server --hot
谢谢。
webpack“ --watch”与“ --hot”:有什么区别?
使用之间有什么区别
webpack --watch
和
webpack-dev-server --hot
谢谢。
第3368篇《webpack“ --watch”与“ --hot”:有什么区别?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
相似问题
问题类别
根据webpack文档@ https://webpack.github.io/docs/tutorials/getting-started/#watch-mode
因此,从根本上说,运行
webpack
和之间的区别webpack --watch
是使用--watch时,CLI将在编译过程中挂起,等待文件中的任何代码更改,如果更改,则它将重新编译并再次等待。您应该知道,如果您使用的是webpack-dev-server,则不需要使用此选项,因为默认情况下,根据其文档,webpack-dev-server使用webpack的监视模式:So, what is
webpack-dev-server --hot
? Basically, this adds theHotModuleReplacementPlugin
to the webpack configuration, which will essentially allow you to only reload the component that is changed instead of doing a full page refresh! Pretty darn useful when you are working with states! According to the documentation:More information on what it is and how to used it here: https://webpack.github.io/docs/webpack-dev-server.html#hot-module-replacement
I hope this helps in understanding webpack a bit more!