Skip to content

Commit 9a8b9f6

Browse files
chore(enhanced): clean manifest alias handling
1 parent d713593 commit 9a8b9f6

File tree

2 files changed

+2
-46
lines changed

2 files changed

+2
-46
lines changed

packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,8 @@ class ConsumeSharedPlugin {
160160
);
161161

162162
// read experiments flag if provided via options
163-
// typings may not include experiments yet; cast to any
164-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
165-
this._aliasConsumption = Boolean(
166-
(options as any)?.experiments?.aliasConsumption,
167-
);
163+
const aliasConsumptionFlag = options.experiments?.aliasConsumption;
164+
this._aliasConsumption = Boolean(aliasConsumptionFlag);
168165
}
169166

170167
createConsumeSharedModule(

packages/enhanced/test/configCases/sharing/next-pages-layer-unify/webpack.config.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,5 @@
11
const { ModuleFederationPlugin } = require('../../../../dist/src');
22
const path = require('path');
3-
const fs = require('fs');
4-
5-
const ensureStub = (relativeTarget, source) => {
6-
const target = path.resolve(__dirname, relativeTarget);
7-
fs.mkdirSync(path.dirname(target), { recursive: true });
8-
fs.writeFileSync(target, source);
9-
};
10-
11-
const exportStub = (bodyLines) =>
12-
[
13-
...bodyLines,
14-
'stub.__esModule = true;',
15-
'stub.default = stub;',
16-
'module.exports = stub;',
17-
'',
18-
].join('\n');
19-
20-
ensureStub(
21-
'node_modules/next/dist/compiled/react.js',
22-
exportStub([
23-
"const stub = { id: 'compiled-react', marker: 'compiled-react', jsx: 'compiled-jsx' };",
24-
]),
25-
);
26-
27-
ensureStub(
28-
'node_modules/next/dist/compiled/react-dom/index.js',
29-
exportStub([
30-
"const stub = { id: 'compiled-react-dom', marker: 'compiled-react-dom' };",
31-
]),
32-
);
33-
34-
ensureStub(
35-
'node_modules/next/dist/compiled/react/jsx-runtime.js',
36-
[
37-
"const stub = { id: 'compiled-react', marker: 'compiled-react', jsx: 'compiled-jsx' };",
38-
'stub.__esModule = true;',
39-
'stub.default = stub;',
40-
'module.exports = stub;',
41-
'',
42-
].join('\n'),
43-
);
443

454
module.exports = {
465
mode: 'development',

0 commit comments

Comments
 (0)