README
umi-plugin-preload
Support preload async chunk for improve page loading performance
Usage
Configure in .umirc.js
,
export default {
plugins: [
['umi-plugin-preload', options],
],
}
Option
{
// useRawFileName 设置为 true 之后 preload.json 中的内容会去掉 hash 值
useRawFileName: false, // default is false
}
API
getChunkByPath
getChunkByPath('/test', preloadConfig); // preloadConfig is the json from preload.json
// => [String, ...]
Features (PR welcome)
- 生成 preload.json
- 支持自动往 HTML 中添加 JS
LICENSE
MIT