Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './combined-pages';
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ module.exports = {
requiredVersion: false,
singleton: true,
},
},
extraOptions: {
skipSharingNextInternals: true,
'react-dom': {
requiredVersion: false,
singleton: true,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const NextFederationPlugin = require('@module-federation/nextjs-mf/lib/NextFederationPlugin');
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
const mfConfig = require('./mf-plugin.config');

module.exports = {
Expand All @@ -8,8 +8,13 @@ module.exports = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
});

config.plugins.push(new NextFederationPlugin(mfConfig));
} else {
config.externals = config.externals || [];
config.externals.push(/^expose_/);
}

return config;
},
// your original next.config.js export
Expand Down
9 changes: 5 additions & 4 deletions federated-css/consumers-nextjs/any-combination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@federated-css/next-any-combination",
"version": "0.1.0",
"scripts": {
"build": "next build",
"start": "next dev -p 8080",
"build": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build",
"start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev -p 8080",
"lint": "next lint"
},
"dependencies": {
Expand All @@ -17,6 +17,7 @@
"devDependencies": {
"@types/react": "18.3.3",
"eslint": "9.6.0",
"eslint-config-next": "14.2.4"
"eslint-config-next": "14.2.4",
"cross-env": "7.0.3"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../utils/ensureNmdPolyfill';
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const runtimeNmd = (module) => {
module.paths = module.paths || [];
if (!module.children) {
module.children = [];
}
return module;
};

export const ensureNmdPolyfill = () => {
const runtimes = [];

if (typeof __webpack_require__ === 'function') {
runtimes.push(__webpack_require__);
}

if (
typeof globalThis !== 'undefined' &&
typeof globalThis.__webpack_require__ === 'function'
) {
runtimes.push(globalThis.__webpack_require__);
}

if (typeof Function.prototype.nmd !== 'function') {
Function.prototype.nmd = runtimeNmd;
}

for (const runtime of runtimes) {
if (typeof runtime.nmd !== 'function') {
runtime.nmd = runtimeNmd;
}
}

if (
typeof globalThis !== 'undefined' &&
typeof globalThis.__webpack_require__ !== 'function' &&
runtimes.length > 0
) {
globalThis.__webpack_require__ = runtimes[0];
}
};

ensureNmdPolyfill();

export default ensureNmdPolyfill;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './combined-pages';
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ module.exports = {
requiredVersion: false,
singleton: true,
},
},
extraOptions: {
skipSharingNextInternals: true,
'react-dom': {
requiredVersion: false,
singleton: true,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const NextFederationPlugin = require('@module-federation/nextjs-mf/lib/NextFederationPlugin');
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
const mfConfig = require('./mf-plugin.config');

module.exports = {
Expand All @@ -8,8 +8,13 @@ module.exports = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
});

config.plugins.push(new NextFederationPlugin(mfConfig));
} else {
config.externals = config.externals || [];
config.externals.push(/^expose_/);
}

return config;
},
// your original next.config.js export
Expand Down
9 changes: 5 additions & 4 deletions federated-css/consumers-nextjs/combination-of-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@federated-css/next-combination-of-4",
"version": "0.1.0",
"scripts": {
"build": "next build",
"start": "next dev -p 8081",
"build": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build",
"start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev -p 8081",
"lint": "next lint"
},
"dependencies": {
Expand All @@ -17,6 +17,7 @@
"devDependencies": {
"@types/react": "18.3.3",
"eslint": "9.6.0",
"eslint-config-next": "14.2.4"
"eslint-config-next": "14.2.4",
"cross-env": "7.0.3"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../utils/ensureNmdPolyfill';
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const runtimeNmd = (module) => {
module.paths = module.paths || [];
if (!module.children) {
module.children = [];
}
return module;
};

export const ensureNmdPolyfill = () => {
const runtimes = [];

if (typeof __webpack_require__ === 'function') {
runtimes.push(__webpack_require__);
}

if (
typeof globalThis !== 'undefined' &&
typeof globalThis.__webpack_require__ === 'function'
) {
runtimes.push(globalThis.__webpack_require__);
}

if (typeof Function.prototype.nmd !== 'function') {
Function.prototype.nmd = runtimeNmd;
}

for (const runtime of runtimes) {
if (typeof runtime.nmd !== 'function') {
runtime.nmd = runtimeNmd;
}
}

if (
typeof globalThis !== 'undefined' &&
typeof globalThis.__webpack_require__ !== 'function' &&
runtimes.length > 0
) {
globalThis.__webpack_require__ = runtimes[0];
}
};

ensureNmdPolyfill();

export default ensureNmdPolyfill;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './combined-pages';
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ module.exports = {
requiredVersion: false,
singleton: true,
},
},
extraOptions: {
skipSharingNextInternals: true,
'react-dom': {
requiredVersion: false,
singleton: true,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const NextFederationPlugin = require('@module-federation/nextjs-mf/lib/NextFederationPlugin');
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
const mfConfig = require('./mf-plugin.config');

module.exports = {
Expand All @@ -8,8 +8,13 @@ module.exports = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
});

config.plugins.push(new NextFederationPlugin(mfConfig));
} else {
config.externals = config.externals || [];
config.externals.push(/^expose_/);
}

return config;
},
// your original next.config.js export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@federated-css/next-jss-and-tailwind-global",
"version": "0.1.0",
"scripts": {
"build": "next build",
"start": "next dev -p 8082",
"build": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build",
"start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev -p 8082",
"lint": "next lint"
},
"dependencies": {
Expand All @@ -17,6 +17,7 @@
"devDependencies": {
"@types/react": "18.3.3",
"eslint": "9.6.0",
"eslint-config-next": "14.2.4"
"eslint-config-next": "14.2.4",
"cross-env": "7.0.3"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../utils/ensureNmdPolyfill';
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const runtimeNmd = (module) => {
module.paths = module.paths || [];
if (!module.children) {
module.children = [];
}
return module;
};

export const ensureNmdPolyfill = () => {
const runtimes = [];

if (typeof __webpack_require__ === 'function') {
runtimes.push(__webpack_require__);
}

if (
typeof globalThis !== 'undefined' &&
typeof globalThis.__webpack_require__ === 'function'
) {
runtimes.push(globalThis.__webpack_require__);
}

if (typeof Function.prototype.nmd !== 'function') {
Function.prototype.nmd = runtimeNmd;
}

for (const runtime of runtimes) {
if (typeof runtime.nmd !== 'function') {
runtime.nmd = runtimeNmd;
}
}

if (
typeof globalThis !== 'undefined' &&
typeof globalThis.__webpack_require__ !== 'function' &&
runtimes.length > 0
) {
globalThis.__webpack_require__ = runtimes[0];
}
};

ensureNmdPolyfill();

export default ensureNmdPolyfill;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './combined-pages';
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ module.exports = {
requiredVersion: false,
singleton: true,
},
},
extraOptions: {
skipSharingNextInternals: true,
'react-dom': {
requiredVersion: false,
singleton: true,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const NextFederationPlugin = require('@module-federation/nextjs-mf/lib/NextFederationPlugin');
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
const mfConfig = require('./mf-plugin.config');

module.exports = {
Expand All @@ -8,8 +8,13 @@ module.exports = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
});

config.plugins.push(new NextFederationPlugin(mfConfig));
} else {
config.externals = config.externals || [];
config.externals.push(/^expose_/);
}

return config;
},
// your original next.config.js export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@federated-css/next-jss-css-and-tailwind-module",
"version": "0.1.0",
"scripts": {
"build": "next build",
"start": "next dev -p 8083",
"build": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build",
"start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev -p 8083",
"lint": "next lint"
},
"dependencies": {
Expand All @@ -17,6 +17,7 @@
"devDependencies": {
"@types/react": "18.3.3",
"eslint": "9.6.0",
"eslint-config-next": "14.2.4"
"eslint-config-next": "14.2.4",
"cross-env": "7.0.3"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../utils/ensureNmdPolyfill';
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
Expand Down
Loading
Loading