11const { withNx } = require ( '@nx/next/plugins/with-nx' ) ;
2- const { workspaceRoot } = require ( 'nx/src/utils/workspace-root' ) ;
3-
4- const path = require ( 'path' ) ;
52const NextFederationPlugin = require ( '@module-federation/nextjs-mf' ) ;
6- const fs = require ( 'fs' ) ;
7-
8- // function renameDefaultDelegate() {
9- // const filesToRename = [
10- // {
11- // oldPath: path.resolve(
12- // __dirname,
13- // '../../dist/packages/nextjs-mf/src/default-delegate.js',
14- // ),
15- // newPath: path.resolve(
16- // __dirname,
17- // '../../dist/packages/nextjs-mf/src/default-delegate.cjs',
18- // ),
19- // },
20- // {
21- // oldPath: path.resolve(
22- // __dirname,
23- // '../../dist/packages/nextjs-mf/src/federation-noop.js',
24- // ),
25- // newPath: path.resolve(
26- // __dirname,
27- // '../../dist/packages/nextjs-mf/src/federation-noop.cjs',
28- // ),
29- // },
30- // ];
31-
32- // filesToRename.forEach(({ oldPath, newPath }) => {
33- // fs.rename(oldPath, newPath, function (err) {
34- // if (err) {
35- // // Do not log error
36- // }
37- // });
38- // });
39- // }
40- // try {
41- // renameDefaultDelegate();
42- // } catch (e) {
43- // /* empty */
44- // }
45- const {
46- createDelegatedModule,
47- } = require ( '@module-federation/nextjs-mf/utilities' ) ;
483
494/**
505 * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions }
@@ -60,35 +15,12 @@ const nextConfig = {
6015
6116 // used for testing build output snapshots
6217 const remotes = {
63- // shop: {
64- // name: 'shop',
65- // alias: 'shop',
66- // entry: `http://localhost:3001/_next/static/${
67- // isServer ? 'ssr' : 'chunks'
68- // }/remoteEntry.js`,
69- // },
70- // checkout: {
71- // name: 'checkout',
72- // alias: 'checkout',
73- // entry: `http://localhost:3002/_next/static/${
74- // isServer ? 'ssr' : 'chunks'
75- // }/remoteEntry.js`,
76- // },
77- // shop: createDelegatedModule(require.resolve('./remote-delegate.js'), {
78- // remote: `shop@http://localhost:3001/_next/static/${
79- // isServer ? 'ssr' : 'chunks'
80- // }/remoteEntry.js`,
81- // }),
82- // checkout: createDelegatedModule(require.resolve('./remote-delegate.js'), {
83- // remote: `checkout@http://localhost:3002/_next/static/${isServer ? 'ssr' : 'chunks'}/remoteEntry.js`,
84- // }),
85-
86- // shop: `shop@http://localhost:3001/_next/static/${
87- // isServer ? 'ssr' : 'chunks'
88- // }/remoteEntry.js`,
8918 checkout : `checkout@http://localhost:3002/_next/static/${
9019 isServer ? 'ssr' : 'chunks'
9120 } /remoteEntry.js`,
21+ home_app : `home_app@http://localhost:3000/_next/static/${
22+ isServer ? 'ssr' : 'chunks'
23+ } /remoteEntry.js`,
9224 shop : `shop@http://localhost:3001/_next/static/${
9325 isServer ? 'ssr' : 'chunks'
9426 } /remoteEntry.js`,
@@ -115,8 +47,6 @@ const nextConfig = {
11547 exposePages : true ,
11648 enableImageLoaderFix : true ,
11749 enableUrlLoaderFix : true ,
118- skipSharingNextInternals : false ,
119- automaticPageStitching : false ,
12050 } ,
12151 } ) ,
12252 ) ;
0 commit comments