Skip to content

Commit a1dba6a

Browse files
committed
fix: improve CSS resource matching in element resource categorization
1 parent c430f99 commit a1dba6a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/view/frontend/web/js/inspector/vitals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export const vitalsMethods = {
214214

215215
// Categorize
216216
if (resource.name.match(/\.(js|mjs)$/)) result.byType.script++;
217-
else if (resource.name.includes('.css')) result.byType.css++;
217+
else if (resource.name.match(/\.css(\?.*)?$/)) result.byType.css++;
218218
else if (resource.name.match(/\.(jpg|jpeg|png|gif|webp|svg|avif)$/i)) result.byType.img++;
219219
else if (resource.name.match(/\.(woff2?|ttf|otf|eot)$/i)) result.byType.font++;
220220
else result.byType.other++;

0 commit comments

Comments
 (0)