function removeLoaderRule(rule) {
  return prevConfig => {
    const newRules = prevConfig.module.rules.filter(
      prevRule =>
        !(
          isLoaderConditionMatching(prevRule.test, rule.test) &&
          isLoaderConditionMatching(prevRule.include, rule.include) &&
          isLoaderConditionMatching(prevRule.exclude, rule.exclude)
        )
    )

    return Object.assign({}, prevConfig, {
      module: Object.assign({}, prevConfig.module, {
        rules: newRules
      })
    })
  }
}
@param {object} rule   Remove all loaders that match this loader rule.
@return {Function}