/*
 * @Author: jixiang
 * @Date: 2021-07-07 16:03:09
 * @Description: 加载Plugins
 * @FilePath: /vite-project/src/plugins/index.ts
 * One World One Drefeel(56580223@qq.com)
 */
import { createApp } from 'vue'

/**
 * @description 加载所有 Plugins
 * @param  {ReturnType<typeofcreateApp>} app 整个应用的实例
 */
export function loadAllPlugins(app: ReturnType<typeof createApp>) {

  const files: any = import.meta.globEager("/src/plugins/*.ts")
  
  Object.keys(files).forEach((key:any) => {
    if (typeof files[key].default === 'function') {
      if (key !== './index.ts') files[key].default(app)
    }
    
  })
}
