code: function readPlugin(pluginDir, enableLocales) {
    if (pluginDir.endsWith('.js') && (0, _utils.isFile)(pluginDir)) {
      return {
        dir: pluginDir,
        config: pluginDir
      };
    }
  
    let locales = {};
    let localesDir = _path2.default.join(pluginDir, 'locales');
    if ((0, _utils.isDirectory)(localesDir)) {
      _fs2.default.readdirSync(localesDir).forEach(locale => {
        if (enableLocales.indexOf(locale) < 0) return;
        let file = _path2.default.join(localesDir, locale, 'messages.js');
        if ((0, _utils.isFile)(file)) {
          locales[locale] = file;
        }
      });
    }
  
    let classFile = _path2.default.join(pluginDir, 'index.js');
    if (!(0, _utils.isFile)(classFile)) {
      classFile = '';
    }
  
    let res = {
      dir: pluginDir,
      config: '',
      pluginClass: classFile,
      api: getFiles(_path2.default.join(pluginDir, 'api')),
      controllers: getFiles(_path2.default.join(pluginDir, 'controllers')),
      routes: getFiles(_path2.default.join(pluginDir, 'routes')),
      models: getFiles(_path2.default.join(pluginDir, 'models')),
      sleds: getFiles(_path2.default.join(pluginDir, 'sleds')),
      locales
    };
  
    let configFile = _path2.default.join(pluginDir, 'config.js');
    if ((0, _utils.isFile)(configFile)) {
      res.config = configFile;
    }
  
    return res;
  }
docs: 读取插件详细信息
  @param {string} pluginDir
  @param {string[]} enableLocales