Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化打开默认浏览器的时机,由webpack-dev-server启动成功打开,改为编译完成之后打开,以降低Node.js内存占用率 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gzcz
Copy link

@gzcz gzcz commented Apr 19, 2019

  1. 使用webpack-dev-server的listen方法的回调函数打开默认浏览器,会导致WebPack在打包时浏览器已打开,一直在加载中等待反馈,内存消耗。
  2. 改为使用open-browser-webpack-plugin push到webpack.plugins的插件中时,只有打包完成了,才打开默认浏览器。降低了内存占用率。

@HuangQiii
Copy link
Contributor

@gzcz 修改方式和初衷都是可以理解的,在这里讨论下必要性。

我认为:

  1. 当编译开始弹出一个框表示反馈,说明开始进入编译部分了
  2. 当编译完页面直接渲染出来,而不是这时候弹出来比较突兀而且不可控(编译时间很长就很晚弹出来,甚至报错了就不弹出来)会很疑惑
  3. 这个内存占用率的问题,应该不是很明显的一个问题吧?(如果有比较直观地检测请告诉我)

在facebook提供的create-react-app中,是直接开启浏览器的。

在阿里的fusion design提供的脚手架中,索性是不打开这个页面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants