umi-plugin-preload

0.2.5 • Public • Published

umi-plugin-preload

NPM version NPM downloads

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

Readme

Keywords

none

Package Sidebar

Install

npm i umi-plugin-preload

Weekly Downloads

25

Version

0.2.5

License

MIT

Unpacked Size

32.5 kB

Total Files

15

Last publish

Collaborators

  • ikobe
  • sorrycc
  • yutingzhao1991