Skip to content

Commit 8381233

Browse files
authored
fix(dev): Append styles to head even for duplicates, fix key construction (#683)
1 parent be78ec0 commit 8381233

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/lib/src/prod/expose-production.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,21 @@ export function prodExposePlugin(
116116
} else {
117117
href = cssPath;
118118
}
119+
120+
if (dontAppendStylesToHead) {
121+
const key = 'css__${options.name}__' + exposeItemName;
122+
window[key] = window[key] || [];
123+
window[key].push(href);
124+
return;
125+
}
119126
120127
if (href in seen) return;
121128
seen[href] = true;
122129
123-
if (!dontAppendStylesToHead) {
124-
const element = document.createElement('link');
125-
element.rel = 'stylesheet';
126-
element.href = href;
127-
document.head.appendChild(element);
128-
return;
129-
}
130-
131-
const key = 'css__${options.name}__' + exposeItemName;
132-
window[key] = window[key] || [];
133-
window[key].push(href);
130+
const element = document.createElement('link');
131+
element.rel = 'stylesheet';
132+
element.href = href;
133+
document.head.appendChild(element);
134134
});
135135
};
136136
async function __federation_import(name) {

0 commit comments

Comments
 (0)