Skip to content

Commit dc0e278

Browse files
committed
Don't load script tags with the nomodule attribute
These tags should not be loaded as we support ES modules.
1 parent b2605dd commit dc0e278

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/browser/browser.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,12 @@ pub const Page = struct {
759759
return null;
760760
}
761761

762+
if (try parser.elementGetAttribute(e, "nomodule") != null) {
763+
// these scripts should only be loaded if we don't support modules
764+
// but since we do support modules, we can just skip them.
765+
return null;
766+
}
767+
762768
const kind = parseKind(try parser.elementGetAttribute(e, "type")) orelse {
763769
return null;
764770
};

0 commit comments

Comments
 (0)