@module-federation/nextjs-mf 8.3.4 → 8.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/dist/client/UrlNode.d.ts +0 -17
- package/dist/client/UrlNode.js +0 -150
- package/dist/client/UrlNode.js.map +0 -1
- package/dist/node.d.ts +0 -1
- package/dist/node.js +0 -18
- package/dist/node.js.map +0 -1
- package/dist/package.json +0 -99
- package/dist/src/federation-noop.d.ts +0 -0
- package/dist/src/federation-noop.js +0 -15
- package/dist/src/federation-noop.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +0 -12
- package/dist/src/index.js.map +0 -1
- package/dist/src/internal.d.ts +0 -48
- package/dist/src/internal.js +0 -177
- package/dist/src/internal.js.map +0 -1
- package/dist/src/loaders/fixImageLoader.d.ts +0 -22
- package/dist/src/loaders/fixImageLoader.js +0 -114
- package/dist/src/loaders/fixImageLoader.js.map +0 -1
- package/dist/src/loaders/fixUrlLoader.d.ts +0 -13
- package/dist/src/loaders/fixUrlLoader.js +0 -25
- package/dist/src/loaders/fixUrlLoader.js.map +0 -1
- package/dist/src/loaders/helpers.d.ts +0 -17
- package/dist/src/loaders/helpers.js +0 -60
- package/dist/src/loaders/helpers.js.map +0 -1
- package/dist/src/loaders/nextPageMapLoader.d.ts +0 -24
- package/dist/src/loaders/nextPageMapLoader.js +0 -167
- package/dist/src/loaders/nextPageMapLoader.js.map +0 -1
- package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +0 -5
- package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.js +0 -19
- package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.js.map +0 -1
- package/dist/src/plugins/CopyFederationPlugin.d.ts +0 -20
- package/dist/src/plugins/CopyFederationPlugin.js +0 -71
- package/dist/src/plugins/CopyFederationPlugin.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.d.ts +0 -23
- package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js +0 -73
- package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.d.ts +0 -60
- package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.js +0 -170
- package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/index.d.ts +0 -27
- package/dist/src/plugins/NextFederationPlugin/index.js +0 -160
- package/dist/src/plugins/NextFederationPlugin/index.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/next-fragments.d.ts +0 -18
- package/dist/src/plugins/NextFederationPlugin/next-fragments.js +0 -61
- package/dist/src/plugins/NextFederationPlugin/next-fragments.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/regex-equal.d.ts +0 -14
- package/dist/src/plugins/NextFederationPlugin/regex-equal.js +0 -25
- package/dist/src/plugins/NextFederationPlugin/regex-equal.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.d.ts +0 -8
- package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js +0 -31
- package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/set-options.d.ts +0 -20
- package/dist/src/plugins/NextFederationPlugin/set-options.js +0 -38
- package/dist/src/plugins/NextFederationPlugin/set-options.js.map +0 -1
- package/dist/src/plugins/NextFederationPlugin/validate-options.d.ts +0 -25
- package/dist/src/plugins/NextFederationPlugin/validate-options.js +0 -46
- package/dist/src/plugins/NextFederationPlugin/validate-options.js.map +0 -1
- package/dist/src/plugins/container/EmbeddedContainerPlugin.d.ts +0 -11
- package/dist/src/plugins/container/EmbeddedContainerPlugin.js +0 -23
- package/dist/src/plugins/container/EmbeddedContainerPlugin.js.map +0 -1
- package/dist/src/plugins/container/InvertedContainerPlugin.d.ts +0 -15
- package/dist/src/plugins/container/InvertedContainerPlugin.js +0 -25
- package/dist/src/plugins/container/InvertedContainerPlugin.js.map +0 -1
- package/dist/src/plugins/container/InvertedContainerRuntimeModule.d.ts +0 -11
- package/dist/src/plugins/container/InvertedContainerRuntimeModule.js +0 -50
- package/dist/src/plugins/container/InvertedContainerRuntimeModule.js.map +0 -1
- package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.d.ts +0 -39
- package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js +0 -72
- package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js.map +0 -1
- package/dist/src/plugins/container/runtimePlugin.d.ts +0 -2
- package/dist/src/plugins/container/runtimePlugin.js +0 -166
- package/dist/src/plugins/container/runtimePlugin.js.map +0 -1
- package/dist/src/plugins/container/types.d.ts +0 -2
- package/dist/src/plugins/container/types.js +0 -3
- package/dist/src/plugins/container/types.js.map +0 -1
- package/dist/src/types.d.ts +0 -28
- package/dist/src/types.js +0 -3
- package/dist/src/types.js.map +0 -1
- package/dist/utilities.d.ts +0 -1
- package/dist/utilities.js +0 -18
- package/dist/utilities.js.map +0 -1
- package/dist/utils/build-utils.d.ts +0 -10
- package/dist/utils/build-utils.js +0 -24
- package/dist/utils/build-utils.js.map +0 -1
- package/dist/utils/flushedChunks.d.ts +0 -22
- package/dist/utils/flushedChunks.js +0 -67
- package/dist/utils/flushedChunks.js.map +0 -1
- package/dist/utils/index.d.ts +0 -27
- package/dist/utils/index.js +0 -69
- package/dist/utils/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/nextjs-mf",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"fast-glob": "^3.2.11",
|
|
42
42
|
"webpack-sources": "^3.2.3",
|
|
43
43
|
"eventemitter3": "^5.0.0",
|
|
44
|
-
"@module-federation/utilities": "3.0.
|
|
45
|
-
"@module-federation/runtime": "0.1.
|
|
46
|
-
"@module-federation/sdk": "0.1.
|
|
47
|
-
"@module-federation/enhanced": "0.1.
|
|
48
|
-
"@module-federation/node": "2.1.
|
|
44
|
+
"@module-federation/utilities": "3.0.10",
|
|
45
|
+
"@module-federation/runtime": "0.1.5",
|
|
46
|
+
"@module-federation/sdk": "0.1.5",
|
|
47
|
+
"@module-federation/enhanced": "0.1.5",
|
|
48
|
+
"@module-federation/node": "2.1.5",
|
|
49
49
|
"@module-federation/webpack-type": "0.0.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
package/dist/client/UrlNode.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This class provides a logic of sorting dynamic routes in NextJS.
|
|
3
|
-
*
|
|
4
|
-
* It was copied from
|
|
5
|
-
* @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts
|
|
6
|
-
*/
|
|
7
|
-
export declare class UrlNode {
|
|
8
|
-
placeholder: boolean;
|
|
9
|
-
children: Map<string, UrlNode>;
|
|
10
|
-
slugName: string | null;
|
|
11
|
-
restSlugName: string | null;
|
|
12
|
-
optionalRestSlugName: string | null;
|
|
13
|
-
insert(urlPath: string): void;
|
|
14
|
-
smoosh(): string[];
|
|
15
|
-
private _smoosh;
|
|
16
|
-
private _insert;
|
|
17
|
-
}
|
package/dist/client/UrlNode.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UrlNode = void 0;
|
|
4
|
-
// TODO: fix the no-non-null assertion errors
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
6
|
-
/**
|
|
7
|
-
* This class provides a logic of sorting dynamic routes in NextJS.
|
|
8
|
-
*
|
|
9
|
-
* It was copied from
|
|
10
|
-
* @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts
|
|
11
|
-
*/
|
|
12
|
-
class UrlNode {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.placeholder = true;
|
|
15
|
-
this.children = new Map();
|
|
16
|
-
this.slugName = null;
|
|
17
|
-
this.restSlugName = null;
|
|
18
|
-
this.optionalRestSlugName = null;
|
|
19
|
-
}
|
|
20
|
-
insert(urlPath) {
|
|
21
|
-
this._insert(urlPath.split('/').filter(Boolean), [], false);
|
|
22
|
-
}
|
|
23
|
-
smoosh() {
|
|
24
|
-
return this._smoosh();
|
|
25
|
-
}
|
|
26
|
-
_smoosh(prefix = '/') {
|
|
27
|
-
const childrenPaths = [...this.children.keys()].sort();
|
|
28
|
-
if (this.slugName !== null) {
|
|
29
|
-
childrenPaths.splice(childrenPaths.indexOf('[]'), 1);
|
|
30
|
-
}
|
|
31
|
-
if (this.restSlugName !== null) {
|
|
32
|
-
childrenPaths.splice(childrenPaths.indexOf('[...]'), 1);
|
|
33
|
-
}
|
|
34
|
-
if (this.optionalRestSlugName !== null) {
|
|
35
|
-
childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1);
|
|
36
|
-
}
|
|
37
|
-
const routes = childrenPaths
|
|
38
|
-
.map((c) => this.children.get(c)._smoosh(`${prefix}${c}/`))
|
|
39
|
-
.reduce((prev, curr) => [...prev, ...curr], []);
|
|
40
|
-
if (this.slugName !== null) {
|
|
41
|
-
routes.push(...this.children.get('[]')._smoosh(`${prefix}[${this.slugName}]/`));
|
|
42
|
-
}
|
|
43
|
-
if (!this.placeholder) {
|
|
44
|
-
const r = prefix === '/' ? '/' : prefix.slice(0, -1);
|
|
45
|
-
if (this.optionalRestSlugName != null) {
|
|
46
|
-
throw new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`);
|
|
47
|
-
}
|
|
48
|
-
routes.unshift(r);
|
|
49
|
-
}
|
|
50
|
-
if (this.restSlugName !== null) {
|
|
51
|
-
routes.push(...this.children
|
|
52
|
-
.get('[...]')
|
|
53
|
-
._smoosh(`${prefix}[...${this.restSlugName}]/`));
|
|
54
|
-
}
|
|
55
|
-
if (this.optionalRestSlugName !== null) {
|
|
56
|
-
routes.push(...this.children
|
|
57
|
-
.get('[[...]]')
|
|
58
|
-
._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
|
|
59
|
-
}
|
|
60
|
-
return routes;
|
|
61
|
-
}
|
|
62
|
-
_insert(urlPaths, slugNames, isCatchAll) {
|
|
63
|
-
if (urlPaths.length === 0) {
|
|
64
|
-
this.placeholder = false;
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (isCatchAll) {
|
|
68
|
-
throw new Error(`Catch-all must be the last part of the URL.`);
|
|
69
|
-
}
|
|
70
|
-
// The next segment in the urlPaths list
|
|
71
|
-
let nextSegment = urlPaths[0];
|
|
72
|
-
// Check if the segment matches `[something]`
|
|
73
|
-
if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {
|
|
74
|
-
// Strip `[` and `]`, leaving only `something`
|
|
75
|
-
let segmentName = nextSegment.slice(1, -1);
|
|
76
|
-
let isOptional = false;
|
|
77
|
-
if (segmentName.startsWith('[') && segmentName.endsWith(']')) {
|
|
78
|
-
// Strip optional `[` and `]`, leaving only `something`
|
|
79
|
-
segmentName = segmentName.slice(1, -1);
|
|
80
|
-
isOptional = true;
|
|
81
|
-
}
|
|
82
|
-
if (segmentName.startsWith('...')) {
|
|
83
|
-
// Strip `...`, leaving only `something`
|
|
84
|
-
segmentName = segmentName.substring(3);
|
|
85
|
-
isCatchAll = true;
|
|
86
|
-
}
|
|
87
|
-
if (segmentName.startsWith('[') || segmentName.endsWith(']')) {
|
|
88
|
-
throw new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`);
|
|
89
|
-
}
|
|
90
|
-
if (segmentName.startsWith('.')) {
|
|
91
|
-
throw new Error(`Segment names may not start with erroneous periods ('${segmentName}').`);
|
|
92
|
-
}
|
|
93
|
-
const handleSlug = function handleSlug(previousSlug, nextSlug) {
|
|
94
|
-
if (previousSlug !== null && previousSlug !== nextSlug) {
|
|
95
|
-
throw new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`);
|
|
96
|
-
}
|
|
97
|
-
slugNames.forEach((slug) => {
|
|
98
|
-
if (slug === nextSlug) {
|
|
99
|
-
throw new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`);
|
|
100
|
-
}
|
|
101
|
-
if (slug.replace(/\W/g, '') === nextSegment.replace(/\W/g, '')) {
|
|
102
|
-
throw new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
slugNames.push(nextSlug);
|
|
106
|
-
};
|
|
107
|
-
if (isCatchAll) {
|
|
108
|
-
if (isOptional) {
|
|
109
|
-
if (this.restSlugName != null) {
|
|
110
|
-
throw new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`);
|
|
111
|
-
}
|
|
112
|
-
handleSlug(this.optionalRestSlugName, segmentName);
|
|
113
|
-
// slugName is kept as it can only be one particular slugName
|
|
114
|
-
this.optionalRestSlugName = segmentName;
|
|
115
|
-
// nextSegment is overwritten to [[...]] so that it can later be sorted specifically
|
|
116
|
-
nextSegment = '[[...]]';
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
if (this.optionalRestSlugName != null) {
|
|
120
|
-
throw new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`);
|
|
121
|
-
}
|
|
122
|
-
handleSlug(this.restSlugName, segmentName);
|
|
123
|
-
// slugName is kept as it can only be one particular slugName
|
|
124
|
-
this.restSlugName = segmentName;
|
|
125
|
-
// nextSegment is overwritten to [...] so that it can later be sorted specifically
|
|
126
|
-
nextSegment = '[...]';
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
if (isOptional) {
|
|
131
|
-
throw new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`);
|
|
132
|
-
}
|
|
133
|
-
handleSlug(this.slugName, segmentName);
|
|
134
|
-
// slugName is kept as it can only be one particular slugName
|
|
135
|
-
this.slugName = segmentName;
|
|
136
|
-
// nextSegment is overwritten to [] so that it can later be sorted specifically
|
|
137
|
-
nextSegment = '[]';
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
// If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode
|
|
141
|
-
if (!this.children.has(nextSegment)) {
|
|
142
|
-
this.children.set(nextSegment, new UrlNode());
|
|
143
|
-
}
|
|
144
|
-
this.children
|
|
145
|
-
.get(nextSegment)
|
|
146
|
-
._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
exports.UrlNode = UrlNode;
|
|
150
|
-
//# sourceMappingURL=UrlNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UrlNode.js","sourceRoot":"","sources":["../../client/UrlNode.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,6DAA6D;AAC7D;;;;;GAKG;AACH,MAAa,OAAO;IAApB;QACE,gBAAW,GAAG,IAAI,CAAC;QACnB,aAAQ,GAAyB,IAAI,GAAG,EAAE,CAAC;QAC3C,aAAQ,GAAkB,IAAI,CAAC;QAC/B,iBAAY,GAAkB,IAAI,CAAC;QACnC,yBAAoB,GAAkB,IAAI,CAAC;IAyL7C,CAAC;IAvLC,MAAM,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CA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AAW,CAAC;oBAChC,kFAAkF;oBAClF,WAAW,GAAG,OAAO,CAAC;gBACxB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,UAAU,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CACb,qDAAqD,QAAQ,CAAC,CAAC,CAAC,KAAK,CACtE,CAAC;gBACJ,CAAC;gBACD,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBACvC,6DAA6D;gBAC7D,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;gBAC5B,+EAA+E;gBAC/E,WAAW,GAAG,IAAI,CAAC;YACrB,CAAC;QACH,CAAC;QAED,iFAAiF;QACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,CAAC,QAAQ;aACV,GAAG,CAAC,WAAW,CAAE;aACjB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACvD,CAAC;CACF;AA9LD,0BA8LC"}
|
package/dist/node.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@module-federation/node';
|
package/dist/node.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("@module-federation/node"), exports);
|
|
18
|
-
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
package/dist/package.json
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@module-federation/nextjs-mf",
|
|
3
|
-
"version": "8.3.4",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"main": "./src/index.js",
|
|
6
|
-
"types": "dist/src/index.d.ts",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"description": "Module Federation helper for NextJS",
|
|
9
|
-
"repository": "https://github.com/module-federation/universe/tree/main/packages/nextjs-mf",
|
|
10
|
-
"author": "Zack Jackson <zackary.l.jackson@gmail.com>",
|
|
11
|
-
"contributors": [
|
|
12
|
-
"Pavel Chertorogov, nodkz <pavel.chertorogov@gmail.com> (www.ps.kz)"
|
|
13
|
-
],
|
|
14
|
-
"files": [
|
|
15
|
-
"dist/",
|
|
16
|
-
"README.md"
|
|
17
|
-
],
|
|
18
|
-
"exports": {
|
|
19
|
-
".": "./dist/src/index.js",
|
|
20
|
-
"./utilities": "./dist/utilities.js",
|
|
21
|
-
"./utils": "./dist/utils/index.js",
|
|
22
|
-
"./*": "./*"
|
|
23
|
-
},
|
|
24
|
-
"typesVersions": {
|
|
25
|
-
"*": {
|
|
26
|
-
".": [
|
|
27
|
-
"./dist/src/index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"utils": [
|
|
30
|
-
"./dist/utils/index.d.ts"
|
|
31
|
-
],
|
|
32
|
-
"utilities": [
|
|
33
|
-
"./dist/utilities.d.ts"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"@module-federation/enhanced": "workspace:*",
|
|
42
|
-
"@module-federation/node": "workspace:*",
|
|
43
|
-
"@module-federation/runtime": "workspace:*",
|
|
44
|
-
"@module-federation/runtime-tools": "0.0.8",
|
|
45
|
-
"@module-federation/sdk": "workspace:*",
|
|
46
|
-
"@module-federation/utilities": "workspace:*",
|
|
47
|
-
"@module-federation/webpack-bundler-runtime": "0.0.8",
|
|
48
|
-
"@module-federation/webpack-type": "workspace:*",
|
|
49
|
-
"@types/koa": "2.11.2",
|
|
50
|
-
"@types/node-schedule": "1.3.2",
|
|
51
|
-
"@types/ws": "8.5.3",
|
|
52
|
-
"acorn": "7.4.1",
|
|
53
|
-
"adm-zip": "0.5.10",
|
|
54
|
-
"ansi-colors": "4.1.3",
|
|
55
|
-
"axios": "1.6.7",
|
|
56
|
-
"buffer": "5.7.1",
|
|
57
|
-
"chalk": "3.0.0",
|
|
58
|
-
"chrome-trace-event": "1.0.3",
|
|
59
|
-
"encoding": "^0.1.13",
|
|
60
|
-
"enhanced-resolve": "5.15.0",
|
|
61
|
-
"eslint-scope": "7.2.2",
|
|
62
|
-
"eventemitter3": "^5.0.0",
|
|
63
|
-
"events": "3.3.0",
|
|
64
|
-
"fast-glob": "^3.2.11",
|
|
65
|
-
"find-pkg": "2.0.0",
|
|
66
|
-
"fs-extra": "9.1.0",
|
|
67
|
-
"isomorphic-ws": "5.0.0",
|
|
68
|
-
"koa": "2.11.0",
|
|
69
|
-
"lodash.clonedeepwith": "4.5.0",
|
|
70
|
-
"log4js": "6.9.1",
|
|
71
|
-
"node-schedule": "2.1.0",
|
|
72
|
-
"process": "0.11.10",
|
|
73
|
-
"rambda": "7.5.0",
|
|
74
|
-
"resolve": "1.22.8",
|
|
75
|
-
"schema-utils": "3.3.0",
|
|
76
|
-
"tapable": "2.2.1",
|
|
77
|
-
"upath": "2.0.1",
|
|
78
|
-
"url": "0.11.3",
|
|
79
|
-
"webpack-sources": "^3.2.3",
|
|
80
|
-
"ws": "8.5.0",
|
|
81
|
-
"@module-federation/dts-plugin": "0.1.3",
|
|
82
|
-
"@module-federation/managers": "0.1.3",
|
|
83
|
-
"@module-federation/manifest": "0.1.3",
|
|
84
|
-
"@module-federation/rspack": "0.1.3",
|
|
85
|
-
"@module-federation/third-party-dts-extractor": "0.0.18"
|
|
86
|
-
},
|
|
87
|
-
"peerDependencies": {
|
|
88
|
-
"next": "^12 || ^13 || ^14",
|
|
89
|
-
"react": "^17 || ^18",
|
|
90
|
-
"react-dom": "^17 || ^18",
|
|
91
|
-
"styled-jsx": "*",
|
|
92
|
-
"webpack": "^5.40.0"
|
|
93
|
-
},
|
|
94
|
-
"peerDependenciesMeta": {
|
|
95
|
-
"styled-jsx": {
|
|
96
|
-
"optional": true
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
require('next/head');
|
|
3
|
-
require('next/router');
|
|
4
|
-
require('next/link');
|
|
5
|
-
require('next/script');
|
|
6
|
-
require('next/image');
|
|
7
|
-
require('next/dynamic');
|
|
8
|
-
require('next/error');
|
|
9
|
-
require('next/amp');
|
|
10
|
-
require('styled-jsx');
|
|
11
|
-
require('styled-jsx/style');
|
|
12
|
-
require('next/image');
|
|
13
|
-
// require('react/jsx-dev-runtime');
|
|
14
|
-
require('react/jsx-runtime');
|
|
15
|
-
//# sourceMappingURL=federation-noop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"federation-noop.js","sourceRoot":"","sources":["../../src/federation-noop.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,WAAW,CAAC,CAAC;AACrB,OAAO,CAAC,aAAa,CAAC,CAAC;AACvB,OAAO,CAAC,WAAW,CAAC,CAAC;AACrB,OAAO,CAAC,aAAa,CAAC,CAAC;AACvB,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,OAAO,CAAC,cAAc,CAAC,CAAC;AACxB,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,OAAO,CAAC,UAAU,CAAC,CAAC;AACpB,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC5B,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,oCAAoC;AACpC,OAAO,CAAC,mBAAmB,CAAC,CAAC"}
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NextFederationPlugin = void 0;
|
|
7
|
-
const NextFederationPlugin_1 = __importDefault(require("./plugins/NextFederationPlugin"));
|
|
8
|
-
exports.NextFederationPlugin = NextFederationPlugin_1.default;
|
|
9
|
-
exports.default = NextFederationPlugin_1.default;
|
|
10
|
-
module.exports = NextFederationPlugin_1.default;
|
|
11
|
-
module.exports.NextFederationPlugin = NextFederationPlugin_1.default;
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,0FAAkE;AAEzD,+BAFF,8BAAoB,CAEE;AAC7B,kBAAe,8BAAoB,CAAC;AAEpC,MAAM,CAAC,OAAO,GAAG,8BAAoB,CAAC;AACtC,MAAM,CAAC,OAAO,CAAC,oBAAoB,GAAG,8BAAoB,CAAC"}
|
package/dist/src/internal.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { SharedObject } from '@module-federation/utilities';
|
|
2
|
-
/**
|
|
3
|
-
* @typedef SharedObject
|
|
4
|
-
* @type {object}
|
|
5
|
-
* @property {object} [key] - The key representing the shared object's package name.
|
|
6
|
-
* @property {boolean} key.singleton - Whether the shared object should be a singleton.
|
|
7
|
-
* @property {boolean} key.requiredVersion - Whether a specific version of the shared object is required.
|
|
8
|
-
* @property {boolean} key.eager - Whether the shared object should be eagerly loaded.
|
|
9
|
-
* @property {boolean} key.import - Whether the shared object should be imported or not.
|
|
10
|
-
*/
|
|
11
|
-
export declare const DEFAULT_SHARE_SCOPE: SharedObject;
|
|
12
|
-
/**
|
|
13
|
-
* Defines a default share scope for the browser environment.
|
|
14
|
-
* This function takes the DEFAULT_SHARE_SCOPE and sets eager to undefined and import to undefined for all entries.
|
|
15
|
-
* For 'react', 'react-dom', 'next/router', and 'next/link', it sets eager to true.
|
|
16
|
-
* The module hoisting system relocates these modules into the right runtime and out of the remote.
|
|
17
|
-
*
|
|
18
|
-
* @type {SharedObject}
|
|
19
|
-
* @returns {SharedObject} - The modified share scope for the browser environment.
|
|
20
|
-
*/
|
|
21
|
-
export declare const DEFAULT_SHARE_SCOPE_BROWSER: SharedObject;
|
|
22
|
-
/**
|
|
23
|
-
* Parses the remotes object and checks if they are using a custom promise template or not.
|
|
24
|
-
* If it's a custom promise template, the remote syntax is parsed to get the module name and version number.
|
|
25
|
-
* If the remote value is using the standard remote syntax, a delegated module is created.
|
|
26
|
-
*
|
|
27
|
-
* @param {Record<string, any>} remotes - The remotes object to be parsed.
|
|
28
|
-
* @returns {Record<string, string>} - The parsed remotes object with either the original value,
|
|
29
|
-
* the value for internal or promise delegate module reference, or the created delegated module.
|
|
30
|
-
*/
|
|
31
|
-
export declare const parseRemotes: (remotes: Record<string, any>) => Record<string, string>;
|
|
32
|
-
/**
|
|
33
|
-
* Extracts the delegate modules from the provided remotes object.
|
|
34
|
-
* This function iterates over the remotes object and checks if each remote value is an internal delegate module reference.
|
|
35
|
-
* If it is, the function adds it to the returned object.
|
|
36
|
-
*
|
|
37
|
-
* @param {Record<string, any>} remotes - The remotes object containing delegate module references.
|
|
38
|
-
* @returns {Record<string, string>} - An object containing only the delegate modules from the remotes object.
|
|
39
|
-
*/
|
|
40
|
-
export declare const getDelegates: (remotes: Record<string, any>) => Record<string, string>;
|
|
41
|
-
/**
|
|
42
|
-
* Transforms an array of Error objects into a single string. Each error message is formatted using the 'formatError' function.
|
|
43
|
-
* The resulting error messages are then joined together, separated by newline characters.
|
|
44
|
-
*
|
|
45
|
-
* @param {Error[]} err - An array of Error objects that need to be formatted and combined.
|
|
46
|
-
* @returns {string} - A single string containing all the formatted error messages, separated by newline characters.
|
|
47
|
-
*/
|
|
48
|
-
export declare const toDisplayErrors: (err: Error[]) => string;
|
package/dist/src/internal.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toDisplayErrors = exports.getDelegates = exports.parseRemotes = exports.DEFAULT_SHARE_SCOPE_BROWSER = exports.DEFAULT_SHARE_SCOPE = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @typedef SharedObject
|
|
6
|
-
* @type {object}
|
|
7
|
-
* @property {object} [key] - The key representing the shared object's package name.
|
|
8
|
-
* @property {boolean} key.singleton - Whether the shared object should be a singleton.
|
|
9
|
-
* @property {boolean} key.requiredVersion - Whether a specific version of the shared object is required.
|
|
10
|
-
* @property {boolean} key.eager - Whether the shared object should be eagerly loaded.
|
|
11
|
-
* @property {boolean} key.import - Whether the shared object should be imported or not.
|
|
12
|
-
*/
|
|
13
|
-
exports.DEFAULT_SHARE_SCOPE = {
|
|
14
|
-
'next/dynamic': {
|
|
15
|
-
requiredVersion: undefined,
|
|
16
|
-
singleton: true,
|
|
17
|
-
import: undefined,
|
|
18
|
-
},
|
|
19
|
-
'next/head': {
|
|
20
|
-
requiredVersion: undefined,
|
|
21
|
-
singleton: true,
|
|
22
|
-
import: undefined,
|
|
23
|
-
},
|
|
24
|
-
'next/link': {
|
|
25
|
-
requiredVersion: undefined,
|
|
26
|
-
singleton: true,
|
|
27
|
-
import: undefined,
|
|
28
|
-
},
|
|
29
|
-
'next/router': {
|
|
30
|
-
requiredVersion: false,
|
|
31
|
-
singleton: true,
|
|
32
|
-
import: undefined,
|
|
33
|
-
},
|
|
34
|
-
'next/image': {
|
|
35
|
-
requiredVersion: undefined,
|
|
36
|
-
singleton: true,
|
|
37
|
-
import: undefined,
|
|
38
|
-
},
|
|
39
|
-
'next/script': {
|
|
40
|
-
requiredVersion: undefined,
|
|
41
|
-
singleton: true,
|
|
42
|
-
import: undefined,
|
|
43
|
-
},
|
|
44
|
-
react: {
|
|
45
|
-
singleton: true,
|
|
46
|
-
requiredVersion: false,
|
|
47
|
-
import: false,
|
|
48
|
-
},
|
|
49
|
-
'react/': {
|
|
50
|
-
singleton: true,
|
|
51
|
-
requiredVersion: false,
|
|
52
|
-
import: false,
|
|
53
|
-
},
|
|
54
|
-
'react-dom/': {
|
|
55
|
-
singleton: true,
|
|
56
|
-
requiredVersion: false,
|
|
57
|
-
import: false,
|
|
58
|
-
},
|
|
59
|
-
'react-dom': {
|
|
60
|
-
singleton: true,
|
|
61
|
-
requiredVersion: false,
|
|
62
|
-
import: false,
|
|
63
|
-
},
|
|
64
|
-
'react/jsx-dev-runtime': {
|
|
65
|
-
singleton: true,
|
|
66
|
-
requiredVersion: undefined,
|
|
67
|
-
},
|
|
68
|
-
'react/jsx-runtime': {
|
|
69
|
-
singleton: true,
|
|
70
|
-
requiredVersion: undefined,
|
|
71
|
-
},
|
|
72
|
-
'styled-jsx': {
|
|
73
|
-
singleton: true,
|
|
74
|
-
import: undefined,
|
|
75
|
-
version: require('styled-jsx/package.json').version,
|
|
76
|
-
requiredVersion: '^' + require('styled-jsx/package.json').version,
|
|
77
|
-
},
|
|
78
|
-
'styled-jsx/style': {
|
|
79
|
-
singleton: true,
|
|
80
|
-
import: false,
|
|
81
|
-
version: require('styled-jsx/package.json').version,
|
|
82
|
-
requiredVersion: '^' + require('styled-jsx/package.json').version,
|
|
83
|
-
},
|
|
84
|
-
'styled-jsx/css': {
|
|
85
|
-
singleton: true,
|
|
86
|
-
import: undefined,
|
|
87
|
-
version: require('styled-jsx/package.json').version,
|
|
88
|
-
requiredVersion: '^' + require('styled-jsx/package.json').version,
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Defines a default share scope for the browser environment.
|
|
93
|
-
* This function takes the DEFAULT_SHARE_SCOPE and sets eager to undefined and import to undefined for all entries.
|
|
94
|
-
* For 'react', 'react-dom', 'next/router', and 'next/link', it sets eager to true.
|
|
95
|
-
* The module hoisting system relocates these modules into the right runtime and out of the remote.
|
|
96
|
-
*
|
|
97
|
-
* @type {SharedObject}
|
|
98
|
-
* @returns {SharedObject} - The modified share scope for the browser environment.
|
|
99
|
-
*/
|
|
100
|
-
exports.DEFAULT_SHARE_SCOPE_BROWSER = Object.entries(exports.DEFAULT_SHARE_SCOPE).reduce((acc, item) => {
|
|
101
|
-
const [key, value] = item;
|
|
102
|
-
// Set eager and import to undefined for all entries, except for the ones specified above
|
|
103
|
-
acc[key] = { ...value, import: undefined };
|
|
104
|
-
return acc;
|
|
105
|
-
}, {});
|
|
106
|
-
/**
|
|
107
|
-
* Checks if the remote value is an internal or promise delegate module reference.
|
|
108
|
-
*
|
|
109
|
-
* @param {string} value - The remote value to check.
|
|
110
|
-
* @returns {boolean} - True if the value is an internal or promise delegate module reference, false otherwise.
|
|
111
|
-
*/
|
|
112
|
-
const isInternalOrPromise = (value) => ['internal ', 'promise '].some((prefix) => value.startsWith(prefix));
|
|
113
|
-
/**
|
|
114
|
-
* Parses the remotes object and checks if they are using a custom promise template or not.
|
|
115
|
-
* If it's a custom promise template, the remote syntax is parsed to get the module name and version number.
|
|
116
|
-
* If the remote value is using the standard remote syntax, a delegated module is created.
|
|
117
|
-
*
|
|
118
|
-
* @param {Record<string, any>} remotes - The remotes object to be parsed.
|
|
119
|
-
* @returns {Record<string, string>} - The parsed remotes object with either the original value,
|
|
120
|
-
* the value for internal or promise delegate module reference, or the created delegated module.
|
|
121
|
-
*/
|
|
122
|
-
const parseRemotes = (remotes) => {
|
|
123
|
-
return Object.entries(remotes).reduce((acc, [key, value]) => {
|
|
124
|
-
if (isInternalOrPromise(value)) {
|
|
125
|
-
// If the value is an internal or promise delegate module reference, keep the original value
|
|
126
|
-
return { ...acc, [key]: value };
|
|
127
|
-
}
|
|
128
|
-
return { ...acc, [key]: value };
|
|
129
|
-
}, {});
|
|
130
|
-
};
|
|
131
|
-
exports.parseRemotes = parseRemotes;
|
|
132
|
-
/**
|
|
133
|
-
* Checks if the remote value is an internal delegate module reference.
|
|
134
|
-
* An internal delegate module reference starts with the string 'internal '.
|
|
135
|
-
*
|
|
136
|
-
* @param {string} value - The remote value to check.
|
|
137
|
-
* @returns {boolean} - Returns true if the value is an internal delegate module reference, otherwise returns false.
|
|
138
|
-
*/
|
|
139
|
-
const isInternalDelegate = (value) => {
|
|
140
|
-
return value.startsWith('internal ');
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Extracts the delegate modules from the provided remotes object.
|
|
144
|
-
* This function iterates over the remotes object and checks if each remote value is an internal delegate module reference.
|
|
145
|
-
* If it is, the function adds it to the returned object.
|
|
146
|
-
*
|
|
147
|
-
* @param {Record<string, any>} remotes - The remotes object containing delegate module references.
|
|
148
|
-
* @returns {Record<string, string>} - An object containing only the delegate modules from the remotes object.
|
|
149
|
-
*/
|
|
150
|
-
const getDelegates = (remotes) => Object.entries(remotes).reduce((acc, [key, value]) => isInternalDelegate(value) ? { ...acc, [key]: value } : acc, {});
|
|
151
|
-
exports.getDelegates = getDelegates;
|
|
152
|
-
/**
|
|
153
|
-
* Takes an error object and formats it into a displayable string.
|
|
154
|
-
* If the error object contains a stack trace, it is appended to the error message.
|
|
155
|
-
*
|
|
156
|
-
* @param {Error} error - The error object to be formatted.
|
|
157
|
-
* @returns {string} - The formatted error message string. If a stack trace is present in the error object, it is appended to the error message.
|
|
158
|
-
*/
|
|
159
|
-
const formatError = (error) => {
|
|
160
|
-
let { message } = error;
|
|
161
|
-
if (error.stack) {
|
|
162
|
-
message += `\n${error.stack}`;
|
|
163
|
-
}
|
|
164
|
-
return message;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Transforms an array of Error objects into a single string. Each error message is formatted using the 'formatError' function.
|
|
168
|
-
* The resulting error messages are then joined together, separated by newline characters.
|
|
169
|
-
*
|
|
170
|
-
* @param {Error[]} err - An array of Error objects that need to be formatted and combined.
|
|
171
|
-
* @returns {string} - A single string containing all the formatted error messages, separated by newline characters.
|
|
172
|
-
*/
|
|
173
|
-
const toDisplayErrors = (err) => {
|
|
174
|
-
return err.map(formatError).join('\n');
|
|
175
|
-
};
|
|
176
|
-
exports.toDisplayErrors = toDisplayErrors;
|
|
177
|
-
//# sourceMappingURL=internal.js.map
|
package/dist/src/internal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAiB;IAC/C,cAAc,EAAE;QACd,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,SAAS;KAClB;IACD,WAAW,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,SAAS;KAClB;IACD,WAAW,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,SAAS;KAClB;IACD,aAAa,EAAE;QACb,eAAe,EAAE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AACH,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAW,EAAE;IACpD,OAAO,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC,CAAC;AACF;;;;;;;GAOG;AACI,MAAM,YAAY,GAAG,CAC1B,OAA4B,EACJ,EAAE,CAC1B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAC5B,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CACpB,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,EAC5D,EAAE,CACH,CAAC;AAPS,QAAA,YAAY,gBAOrB;AAEJ;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,CAAC,KAAY,EAAU,EAAE;IAC3C,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACxB,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,IAAI,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAAC,GAAY,EAAU,EAAE;IACtD,OAAO,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { LoaderContext } from 'webpack';
|
|
2
|
-
/**
|
|
3
|
-
* This loader is specifically created for tuning the next-image-loader result.
|
|
4
|
-
* It modifies the regular string output of the next-image-loader.
|
|
5
|
-
* For server-side rendering (SSR), it injects the remote scope of a specific remote URL.
|
|
6
|
-
* For client-side rendering (CSR), it injects the document.currentScript.src.
|
|
7
|
-
* After these injections, it selects the full URI before _next.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* http://localhost:1234/test/test2/_next/static/media/ssl.e3019f0e.svg
|
|
11
|
-
* will become
|
|
12
|
-
* http://localhost:1234/test/test2
|
|
13
|
-
*
|
|
14
|
-
* @param {LoaderContext<Record<string, unknown>>} this - The loader context.
|
|
15
|
-
* @param {string} remaining - The remaining part of the resource path.
|
|
16
|
-
* @returns {string} The modified source code with the injected code.
|
|
17
|
-
*/
|
|
18
|
-
export declare function fixImageLoader(this: LoaderContext<Record<string, unknown>>, remaining: string): Promise<string>;
|
|
19
|
-
/**
|
|
20
|
-
* The pitch function of the loader, which is the same as the fixImageLoader function.
|
|
21
|
-
*/
|
|
22
|
-
export declare const pitch: typeof fixImageLoader;
|