wodax-umi-plugin-preload

Support preload async chunk for improve page loading performance

Usage no npm install needed!

<script type="module">
  import wodaxUmiPluginPreload from 'https://cdn.skypack.dev/wodax-umi-plugin-preload';
</script>

README

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