vite-plugin-prefetch-dns
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

vite-plugin-prefetch-dns

A plugin for adding prefetch dns to Vite for personal use!

Features

  • [x] 忽略特定域名
  • [x] 添加pre-connect域名
  • [x] 继承prettier格式化输出index.html
  • [x] 添加最大限制prefetch-dns的个数(按照使用次数排序从多到少)
  • [] 添加阈值
interface DnsPluginOption {
  /**
   * @description: 需要忽略的域名
   */
  ignores?: string[];
  /**
   * @description: 需要预连接的域名
   */
  preConnect?: string[] | string;
  /**
   * @description: prettier 配置
   */
  prettier?: Omit<Options, "parser">;
  /**
   * @description: 最大prefetch-dns次数
   */
  limit?: number;
   /**
   * @description: 阈值:当依赖的域名超过次数时才会被添加
   */
  threshold?: number
}

DnsPluginOption.prettier see prettier Doc

Package Sidebar

Install

npm i vite-plugin-prefetch-dns

Weekly Downloads

0

Version

0.0.10

License

MIT

Unpacked Size

24 kB

Total Files

8

Last publish

Collaborators

  • victliu