Comments (11)
roadhog 的 dllPlugin 实现:
- 默认关闭
- 通过
.roadhogrc
的dllPlugin
配置开启,可以配exclude
和include
的包 - 提供
roadhog buildDll
命令手动打 dll bundle - 开启 dllPlugin 后,
roadhog server
时检到没有manifest.json
,提醒执行roadhog buildDll
- 然后用户还需手动在调试的 html 里引入
roadhog.dll.js
(后面可以考虑用 HtmlWebpackPlugin 生成)
from roadhog.
例子:https://github.com/mxstbr/react-boilerplate
from roadhog.
以 dva-example-user-dashboard 为例,用上 dll 之后能快 2-3 秒。
- 用 dll 之前,10s
- 用 dll 之后,7-8s
依赖多了之后应该能更快点,稍后拿个复杂项目试试看。
from roadhog.
参考:
- https://gist.github.com/robertknight/058a194f45e77ff95fcd
- https://robertknight.github.io/posts/webpack-dll-plugins/
- http://engineering.invisionapp.com/post/optimizing-webpack/
- https://www.zhihu.com/question/31352596
from roadhog.
感觉 antd 由于引入了 babel-plugin-import,所以 antd 部分的 dll 无效,待排查。
from roadhog.
试了一个内部的复杂项目,开启 dll 后,启动时间从 44s -> 29s 。
from roadhog.
考虑什么时候更新到npm呢
from roadhog.
一直在关注这事~~就是最近项目太赶了,好像提pr
from roadhog.
下周吧,这周后面没时间搞这个了。
from roadhog.
以 https://github.com/dvajs/dva-example-user-dashboard 为例,devtool 为 sourcemap 的情况下。未启用 dll 时启动时间 13.2s,修改代码后热编译 2.5s;启用 dll 之后,启动时间 8s,修改代码后热编译 0.7s 。
from roadhog.
求解 exclude
与 include
的作用。。。
from roadhog.
Related Issues (20)
- 从1.x升级到2.x 运行时babel报错
- 升级到2.x之后eslint报错
- 加入websocket代理后crash HOT 1
- 打包后放到服务器上的时候不加载样式,本地却没有问题 HOT 3
- babel-loader isn’t transpiling Quill’s modules because they're inside node_modules/
- 升级2.0以后,libraryTarget没有了,怎么做组件了?在线等 HOT 3
- 指定启动端口无效
- 普通的js,非js组件,如何获得model的值,虽然能挂载window,但是这方法好low
- Module build failed:var content = require("!!../../../../css-loader/index.js!../../../../postcss-loader/lib/index.js!../../../../less-loader/dist/cjs.js??ref--13-3!./index.less"); ^ Unrecognised input in C:\workSpace\git\dap\node_modules\antd\es\auto-complete\style\index.less (line 2, column 12) HOT 1
- less mixins 调用函数直接取变量值时,编译报错 unrecognised input HOT 1
- libraryTarget 、library配置一直报错,期望给出示例
- extraBabelIncludes未应用extraBabelPlugins规则造成无法Uglify的问题
- 2.1.0版本的roadhog怎么设置headers、library、libraryTarget、jsonpFunction
- dva-hmr热更新问题
- 打包 Uglifyjs 报错问题
- 维护一个老的roadhog 1.x项目, 发现配置publicPath不生效. HOT 1
- 构建报UglifyJs错误 HOT 4
- 1.3.1升级到2.4.9报错,Can't resolve '@babel/runtime/helpers/esm/extends' HOT 1
- bug
- 2.x版本的roadhog如何配置postcss-px-to-viewport或者postcss-pxtorem呀? 试了下配置不生效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roadhog.