Federated remotes loading third party CSS - chunk is reloaded every time #794
Unanswered
cristiano-belloni
asked this question in
Q&A
Replies: 1 comment
-
Trailing slash share key or share that file directly If still having issues then Book Calendly time |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I've extended this example for both remotes to not use momentjs but react-vis. With react-vis, you need to import their css, so I have something like that on top of each of the remote
Widget
s:and, in each of the remotes' webpack.config.js, I have these rules to process css:
and this
shared
entry to sharereact-vis
:Everything works as intended, but it seems that, every time I load one of the remote applications, there are now two js files that get loaded for
react-vis
: one containing the javascript code for the library and the other one containing the css rules in javascript:vendors-common_temp_node_modules_pnpm_react-vis_1_11_7_react_16_13_1_node_modules_react-vis_e-cf810e.js
-- js codevendors-common_temp_node_modules_pnpm_react-vis_1_11_7_react_16_13_1_node_modules_react-vis_d-7bdc49.js
-- apparently the css chunk with a js wrapperThe first one is correctly not loaded as I switch from app2 to app3 inside the host, but the second one is always loaded and appended to my
head
. More in detail:script
andstyle
tag are added to myhead
- all ok.style
tag is added to myhead
- not correct, I'd expect 2) not to be loaded and style not to be added.style
tag is added to myhead
- not correct, I'd expect style not to be added.I also tried it with three identical remotes, all sharing react-vis, and I had the same issue: style chunk being reloaded the first time I load a previously-unloaded remote and style tags piling up on my host document
head
every time I load a remote.I also bought and read the book, but this particular situation was not mentioned. Any hint on how to debug / solve this? Or am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions