wodax-umi-plugin-preload

1.0.2 • 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 wodax-umi-plugin-preload

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

21.4 kB

Total Files

10

Last publish

Collaborators

  • sunzhifeng