Skip to content

Commit 20a6c32

Browse files
committed
More generic regexp that would work with https://github.com/EIG6-ArtificIA/predictia_front
1 parent 3f57b4a commit 20a6c32

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/bin/only-include-used-icons.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,15 @@ async function main() {
367367
const lines = indexHtml.split("\n");
368368

369369
const importDsfrIndexLine = lines.findIndex(line =>
370-
/<link\s+rel="stylesheet"\s+href="(.*?%PUBLIC_URL%)?\/dsfr\/dsfr.min.css"\s*\/>/.test(
371-
line
372-
)
370+
/<link.+href=["'](.*?%PUBLIC_URL%)?\/dsfr\/dsfr.min.css["']/.test(line)
373371
);
374372

375373
if (importDsfrIndexLine === -1) {
376374
break reorder_css_imports;
377375
}
378376

379377
if (
380-
!/<link\s+rel="stylesheet"\s+href="(%PUBLIC_URL%)?\/dsfr\/utility\/icons\/icons\.min\.css"\s*\/>/.test(
378+
!/<link.+href=["'](%PUBLIC_URL%)?\/dsfr\/utility\/icons\/icons\.min\.css["']/.test(
381379
lines[importDsfrIndexLine + 1]
382380
)
383381
) {

0 commit comments

Comments
 (0)