"use strict";

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

var _modeUtils = require("../common/modeUtils");

var _CdnChangePlugin = _interopRequireDefault(require("../custom_plugins/CdnChangePlugin"));

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

function configCdnChangePlugin(options) {
  const {
    cdnMapping,
    mode
  } = options;

  if (!cdnMapping.isCdnEnabled || (0, _modeUtils.isDevelopmentMode)(mode)) {
    return null;
  }

  return new _CdnChangePlugin.default({ ...cdnMapping,
    enableSMap: options.enableSMap
  });
}