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

考虑集成 dll 功能用以提升调试效率 #2

Closed
sorrycc opened this issue Dec 14, 2016 · 11 comments
Closed

考虑集成 dll 功能用以提升调试效率 #2

sorrycc opened this issue Dec 14, 2016 · 11 comments

Comments

@sorrycc
Copy link
Owner

sorrycc commented Dec 14, 2016

No description provided.

@sorrycc
Copy link
Owner Author

sorrycc commented Jan 19, 2017

@sorrycc
Copy link
Owner Author

sorrycc commented Mar 28, 2017

以 dva-example-user-dashboard 为例,用上 dll 之后能快 2-3 秒。

  • 用 dll 之前,10s
  • 用 dll 之后,7-8s

依赖多了之后应该能更快点,稍后拿个复杂项目试试看。

@sorrycc
Copy link
Owner Author

sorrycc commented Mar 28, 2017

感觉 antd 由于引入了 babel-plugin-import,所以 antd 部分的 dll 无效,待排查。

@sorrycc
Copy link
Owner Author

sorrycc commented Mar 29, 2017

试了一个内部的复杂项目,开启 dll 后,启动时间从 44s -> 29s 。

@sorrycc
Copy link
Owner Author

sorrycc commented Mar 29, 2017

roadhog 的 dllPlugin 实现:

  1. 默认关闭
  2. 通过 .roadhogrcdllPlugin 配置开启,可以配 excludeinclude 的包
  3. 提供 roadhog buildDll 命令手动打 dll bundle
  4. 开启 dllPlugin 后,roadhog server 时检到没有 manifest.json,提醒执行 roadhog buildDll
  5. 然后用户还需手动在调试的 html 里引入 roadhog.dll.js(后面可以考虑用 HtmlWebpackPlugin 生成)

sorrycc added a commit that referenced this issue Mar 29, 2017
@liuhuapiaoyuan
Copy link

考虑什么时候更新到npm呢

@liuhuapiaoyuan
Copy link

一直在关注这事~~就是最近项目太赶了,好像提pr

@sorrycc
Copy link
Owner Author

sorrycc commented Apr 1, 2017

下周吧,这周后面没时间搞这个了。

@sorrycc
Copy link
Owner Author

sorrycc commented May 5, 2017

screen shot 2017-05-05 at 2 57 23 pm

screen shot 2017-05-05 at 2 59 49 pm

https://github.com/dvajs/dva-example-user-dashboard 为例,devtool 为 sourcemap 的情况下。未启用 dll 时启动时间 13.2s,修改代码后热编译 2.5s;启用 dll 之后,启动时间 8s,修改代码后热编译 0.7s 。

@terminalqo
Copy link

求解 excludeinclude 的作用。。。

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

No branches or pull requests

3 participants