Don't load script tags with the nomodule attribute

These tags should not be loaded as we support ES modules.
This commit is contained in:
Karl Seguin
2025-05-14 16:50:34 +08:00
parent b2605dd30c
commit dc0e278a24

View File

@@ -759,6 +759,12 @@ pub const Page = struct {
return null;
}
if (try parser.elementGetAttribute(e, "nomodule") != null) {
// these scripts should only be loaded if we don't support modules
// but since we do support modules, we can just skip them.
return null;
}
const kind = parseKind(try parser.elementGetAttribute(e, "type")) orelse {
return null;
};