Skip to content

Commit

Permalink
Merge pull request #26 from module-federation/fix_endless_build
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy authored May 20, 2022
2 parents f52f6ad + ab79c99 commit ce2d956
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions flushChunksOrig.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,12 @@ requireMethod.cache[manifestPath].exports = new Proxy(loadableManifest, {
return true;
}
}
console.log(remote.chunkMap.loadable);
if (
remote.chunkMap &&
remote.chunkMap.loadable &&
remote.chunkMap.loadable[prop]
) {
console.log("extracting local import from this loadable map", prop);
console.log(prop, dynamicLoadableManifestItem);
extractLocalRemoteImport(remote, dynamicLoadableManifestItem, prop);
return true;
}
Expand Down
20 changes: 1 addition & 19 deletions lib/with-federated-sidecar.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ const withModuleFederation =
removePlugins,
publicPath,
done,
// mainBuild,
options,
}) {
if (compiler[options.isServer ? "server" : "client"]) {
Expand Down Expand Up @@ -271,7 +270,7 @@ const withModuleFederation =
chunkLoadingGlobal: undefined,
devtoolNamespace: undefined,
uniqueName: federationPluginOptions.name,
// hotUpdateGlobal: "webpackHotUpdate_" + federationPluginOptions.name,
hotUpdateGlobal: "webpackHotUpdate_" + federationPluginOptions.name,
publicPath,
},
cache: false,
Expand Down Expand Up @@ -614,11 +613,6 @@ const withModuleFederation =
* @param {import("webpack").Compiler} compiler
*/
apply(compiler) {
// let mainBuildResolve;
// let mainBuild = new Promise((res) => {
// mainBuildResolve = res;
// });

const run = (compilation, done) => {
return startCompiler({
webpack,
Expand All @@ -628,21 +622,9 @@ const withModuleFederation =
publicPath,
done,
options,
// mainBuild,
});
};

// compiler.hooks.thisCompilation.tap("NextFederation",(compilation)=>{
// run(compilation)
// })

// compiler.hooks.afterEmit.tapAsync(
// "NextFederation",
// (compilation, done) => {
// done();
// mainBuildResolve();
// }
// );
// in production or on server build use tapAsync to wait for the full compilation of the sidecar
if (isProd || compiler.options.mode === "production") {
compiler.hooks.afterCompile.tapAsync(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"public": true,
"name": "@module-federation/nextjs-ssr",
"version": "0.1.0-rc.5",
"version": "0.1.0-rc.6",
"description": "Module Federation CSR & SSR Support for Next.js",
"main": "bundle.js",
"types": "index.d.ts",
Expand Down

0 comments on commit ce2d956

Please sign in to comment.