# 自定义预加载

uni-app 项目中自定义加载资源。

# 如何使用

安装

pnpm add @plugin-light/webpack-plugin-custom-preload -D

vue.config.js 中添加如下设置:

const { CustomPreloadPlugin } = require('@plugin-light/webpack-plugin-custom-preload');

module.exports = {
  configureWebpack: {
    plugins: [
      new CustomPreloadPlugin()
    ],
  }
}

# 参数类型

type IHash = string | RegExp | Array<string>;

export interface ICustomPreloadOptions {
  list?: Array<{
    condition: {
      hash?: IHash;
      path?: IHash;
    };
    pages?: string | Array<string | Array<string>>;
  }>
}

# 更新日志

点此查看

Last Updated: 2025/3/29 16:32:34