Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrnl committed Oct 21, 2021
1 parent 1c0cf1b commit e5667b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions loader.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,15 @@ function processHtml(html, options, loaderCallback) {
let content = [html];
links.reverse().forEach((link) => {
let value;
if (IGNORE_PATTERN.test(link.value) || options.requireIgnore.test(link.value)) return;
if (SRCSET_ATTRS.includes(link.attr)) {
if (IGNORE_PATTERN.test(link.value) || options.requireIgnore.test(link.value)) return;
value = link.value.split(SRCSET_SEPARATOR).map((source) => {
const [url, size = ''] = source.split(SRC_SEPARATOR, 2);
if (IGNORE_PATTERN.test(url) || options.requireIgnore.test(url)) return source;
if (!loaderUtils.isUrlRequest(link.value, options.searchPath)) return source;
return options.requireIdent(url) + (size ? ` ${size}` : '');
}).join(', ');
} else {
if (IGNORE_PATTERN.test(link.value) || options.requireIgnore.test(link.value)) return;
if (!loaderUtils.isUrlRequest(link.value, options.searchPath)) return;
value = options.requireIdent(link.value);
}
Expand Down

0 comments on commit e5667b7

Please sign in to comment.