Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sixty-bugs-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/sdk': patch
---

fix: don't modify loaded tag
38 changes: 19 additions & 19 deletions packages/sdk/src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ export function createScript(info: {
if (createScriptRes.timeout) timeout = createScriptRes.timeout;
}
}
}

const attrs = info.attrs;
if (attrs) {
Object.keys(attrs).forEach((name) => {
if (script) {
if (name === 'async' || name === 'defer') {
script[name] = attrs[name];
} else {
script.setAttribute(name, attrs[name]);
const attrs = info.attrs;
if (attrs) {
Object.keys(attrs).forEach((name) => {
if (script) {
if (name === 'async' || name === 'defer') {
script[name] = attrs[name];
} else {
script.setAttribute(name, attrs[name]);
}
}
}
});
});
}
}

const onScriptComplete = (
Expand Down Expand Up @@ -156,15 +156,15 @@ export function createLink(info: {
link = createLinkRes;
}
}
}

const attrs = info.attrs;
if (attrs) {
Object.keys(attrs).forEach((name) => {
if (link) {
link.setAttribute(name, attrs[name]);
}
});
const attrs = info.attrs;
if (attrs) {
Object.keys(attrs).forEach((name) => {
if (link) {
link.setAttribute(name, attrs[name]);
}
});
}
}

const onLinkComplete = (
Expand Down