"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.configSelectorWeightPlugin = configSelectorWeightPlugin;

var _SelectorWeightPlugin = _interopRequireDefault(require("../custom_plugins/SelectorWeightPlugin"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function configSelectorWeightPlugin(options) {
  const {
    selectorWeight
  } = options.css.plugins;

  if (!selectorWeight.enable) {
    return null;
  }

  return new _SelectorWeightPlugin.default({
    selectorWeightConfig: selectorWeight.configFile,
    defaultSelector: selectorWeight.defaultSelector,
    customFileDetails: selectorWeight.customFileDetails,
    excludeStrings: selectorWeight.excludeStrings,
    patterns: selectorWeight.patterns
  });
}