src/Site.js
function getPluginPath(rootPath, plugin) {
  // Check in project folder
  const pluginPath = path.join(rootPath, PROJECT_PLUGIN_FOLDER_NAME, `${plugin}.js`);
  if (fs.existsSync(pluginPath)) {
    return pluginPath;
  }

  // Check in src folder
  const srcPath = path.join(__dirname, BUILT_IN_PLUGIN_FOLDER_NAME, `${plugin}.js`);
  if (fs.existsSync(srcPath)) {
    return srcPath;
  }

  // Check in default folder
  const defaultPath = path.join(__dirname, BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME, `${plugin}.js`);
  if (fs.existsSync(defaultPath)) {
    return defaultPath;
  }

  return '';
}
function getPluginPath(rootPath, plugin) {
  // Check in project folder
  const pluginPath = path.join(rootPath, PROJECT_PLUGIN_FOLDER_NAME, `${plugin}.js`);
  if (fs.existsSync(pluginPath)) {
    return pluginPath;
  }

  // Check in src folder
  const srcPath = path.join(__dirname, BUILT_IN_PLUGIN_FOLDER_NAME, `${plugin}.js`);
  if (fs.existsSync(srcPath)) {
    return srcPath;
  }

  // Check in default folder
  const defaultPath = path.join(__dirname, BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME, `${plugin}.js`);
  if (fs.existsSync(defaultPath)) {
    return defaultPath;
  }

  return '';
}
function getPluginPath ( rootPath , plugin ) { // Check in project folder const pluginPath = path . join ( rootPath , PROJECT_PLUGIN_FOLDER_NAME , ` ${ plugin } ` ) ; if ( fs . existsSync ( pluginPath ) ) { return pluginPath ; } // Check in src folder const srcPath = path . join ( __dirname , BUILT_IN_PLUGIN_FOLDER_NAME , ` ${ plugin } ` ) ; if ( fs . existsSync ( srcPath ) ) { return srcPath ; } // Check in default folder const defaultPath = path . join ( __dirname , BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME , ` ${ plugin } ` ) ; if ( fs . existsSync ( defaultPath ) ) { return defaultPath ; } return '' ; }
Retrieves the correct plugin path for a plugin name, if not in node_modules
@param rootPath root of the project
@param plugin name of the plugin
Retrieves the correct plugin path for a plugin name if not in node_modules