code: function processOptions(options) {
    // Parse preset names
    const presets = (options.presets || []).map(presetName => {
      const preset = loadBuiltin(availablePresets, presetName);
  
      if (preset) {
        // workaround for babel issue
        // at some point, babel copies the preset, losing the non-enumerable
        // buildPreset key; convert it into an enumerable key.
        if (
          isArray(preset) &&
          typeof preset[0] === "object" &&
          preset[0].hasOwnProperty("buildPreset")
        ) {
          preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset };
        }
      } else {
        throw new Error(
          `Invalid preset specified in Babel options: "${presetName}"`,
        );
      }
      return preset;
    });
  
    // Parse plugin names
    const plugins = (options.plugins || []).map(pluginName => {
      const plugin = loadBuiltin(availablePlugins, pluginName);
  
      if (!plugin) {
        throw new Error(
          `Invalid plugin specified in Babel options: "${pluginName}"`,
        );
      }
      return plugin;
    });
  
    return {
      babelrc: false,
      ...options,
      presets,
      plugins,
    };
  }
docs: Parses plugin names and presets from the specified options.