webpack是单线程
时间: 2023-10-15 19:23:12 浏览: 165
linux下的一个单线程web服务器
是的,webpack是单线程模型的。这意味着webpack需要按照顺序一个一个地处理任务,并且不能同时处理多个任务。这是由于webpack是运行在Node.js之上的,而Node.js是单线程的。因此,为了提高打包效率,可以使用Happypack来将任务分发给子进程去执行,然后再由主线程解析执行结果,从而实现多线程打包进程。这样,webpack就能够发挥多核CPU电脑的威力,提高打包速度。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [webpack5学习:性能优化抽离公共代码以及多线程打包(2)](https://blog.csdn.net/weixin_46831501/article/details/125400506)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [webpack HappyPack实战详解](https://download.csdn.net/download/weixin_38537684/13671854)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文