get-matched-rule.js 374 B

1234567891011121314
  1. const getMatchedRules = require('./get-matched-rules');
  2. /**
  3. * Always returns last matched rule
  4. * @param {string} request
  5. * @param {Rule[]} rules Webpack loaders config
  6. * @return {Rule} Webpack rule
  7. */
  8. function getMatchedRule(request, rules) {
  9. const matched = getMatchedRules(request, rules);
  10. return matched[matched.length - 1];
  11. }
  12. module.exports = getMatchedRule;