lib/config/buildPlugins.js
function resolvePluginsForBrowsers(browsers) {
  const plugins = [];

  if (!Array.isArray(browsers)) browsers = [browsers];

  browsers.forEach(browser => {
    const name = Object.keys(browser)[0];
    const version = browser[name];

    for (const pluginName in babelPluginsByEnvironmentVersion) {
      if (
        !babelPluginsByEnvironmentVersion[pluginName][name] ||
        babelPluginsByEnvironmentVersion[pluginName][name] > version
      ) {
        plugins.push(`babel-plugin-${pluginName}`);
      }
    }
  });

  return plugins;
}
function resolvePluginsForBrowsers(browsers) {
  const plugins = [];

  if (!Array.isArray(browsers)) browsers = [browsers];

  browsers.forEach(browser => {
    const name = Object.keys(browser)[0];
    const version = browser[name];

    for (const pluginName in babelPluginsByEnvironmentVersion) {
      if (
        !babelPluginsByEnvironmentVersion[pluginName][name] ||
        babelPluginsByEnvironmentVersion[pluginName][name] > version
      ) {
        plugins.push(`babel-plugin-${pluginName}`);
      }
    }
  });

  return plugins;
}
function resolvePluginsForBrowsers ( browsers ) { const plugins = [ ] ; if ( ! Array . isArray ( browsers ) ) browsers = [ browsers ] ; browsers . forEach ( browser => { const name = Object . keys ( browser ) [ 0 ] ; const version = browser [ name ] ; for ( const pluginName in babelPluginsByEnvironmentVersion ) { if ( ! babelPluginsByEnvironmentVersion [ pluginName ] [ name ] || babelPluginsByEnvironmentVersion [ pluginName ] [ name ] > version ) { plugins . push ( ` ${ pluginName } ` ) ; } } } ) ; return plugins ; }
Resolve Babel plugins for all 'browsers'
@param {Array} browsers
@returns {Array}
Resolve Babel plugins for all browsers