Giter Site home page Giter Site logo

Comments (11)

sorrycc avatar sorrycc commented on June 25, 2024 14

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 生成)

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

例子:https://github.com/mxstbr/react-boilerplate

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

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

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

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

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

参考:

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

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

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

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

from roadhog.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on June 25, 2024

考虑什么时候更新到npm呢

from roadhog.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on June 25, 2024

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

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

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

from roadhog.

sorrycc avatar sorrycc commented on June 25, 2024

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 。

from roadhog.

terminalqo avatar terminalqo commented on June 25, 2024

求解 excludeinclude 的作用。。。

from roadhog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.