ESM/MJS consumer/remote support for NodeFederationPlugin? #1592
Replies: 1 comment
-
Update: Using version I am needing to add these lines 2 & 3 to my output bundle:
otherwise webpack's lines like I also have to add a webpack.config's But then I'm stuck on this error: If I further hack the loader code (
in an attempt to satisfy:
I realize the initial call is for the manifest bundle pointing to the other entry points. It looks to me like this Of course, this all seems pretty far from what the plugin supports right now and I'm not approaching this from a ESM-first angle since I don't have the background. More like trying to fit a ESM peg in a CJS hole. |
Beta Was this translation helpful? Give feedback.
-
I see there are some unpublished edits of the NodeFederationPlugin. I'm currently stuck with the Aug 2023 version where my ESM host cannot fetch the remote bundle because
require is not defined
. Client-side behavior is working perfectly.If I hack the plugin's output to include
const require = __WEBPACK_EXTERNAL_createRequire(import.meta.url);
then it performs the fetch, but fails in loading the mjs remote withScriptExternalLoadError
.The recent revisions look substantial. Will they support ESM formats? Are they stable? What is the easiest recommended way to experiment with it prior to you publishing? There's a lot of other code in this repo - not sure how small I can stay.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions