From 61241e904d37cda49f457a1ef6d13b80c2b48360 Mon Sep 17 00:00:00 2001 From: Zack Jackson Date: Sun, 25 Oct 2020 10:29:04 -0700 Subject: [PATCH] updated docs (#11) --- README.md | 21 +++++++++++++++++++++ merge-runtime.js | 5 ++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5d54e4f..e5a2884 100644 --- a/README.md +++ b/README.md @@ -90,3 +90,24 @@ class MyDocument extends Document { const Nav = (await import("../components/nav")).default; const _ = await import("lodash"); ``` + +## Experimental + +Use at your own risk. + +Next.js uses `runtimeChunk:'single'` +Which forces us to also add the webpack script itself. Till this is fixed in webpack, heres a plugin that will merge the runtimes back together for MF + +```js +const {MergeRuntime} = require("@module-federation/nexjs-mf"); +// in your next config. +config.plugins.push(new MergeRuntime()); +``` + +This allows the following to be done + +```diff + -