@module-federation/rsbuild-plugin 0.21.5 → 0.22.0
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/dist/index.js +7 -6
- package/dist/index.mjs +7 -6
- package/dist/utils.js +7 -6
- package/dist/utils.mjs +7 -6
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -105,23 +105,24 @@ const addExcludeDtsSuffix = (filepath)=>`${filepath}?exclude-mf-dts=true`;
|
|
|
105
105
|
function addDataFetchExposes(exposes, isServer) {
|
|
106
106
|
if ('object' != typeof exposes || Array.isArray(exposes)) return;
|
|
107
107
|
if (0 === Object.keys(exposes).length) return;
|
|
108
|
-
const
|
|
108
|
+
const tempDataFetch = external_path_default().resolve(process.cwd(), `node_modules/${sdk_namespaceObject.TEMP_DIR}`);
|
|
109
109
|
const content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
110
|
-
external_fs_extra_default().ensureDirSync(
|
|
111
|
-
|
|
112
|
-
Object.keys(exposes).forEach((key)=>{
|
|
110
|
+
external_fs_extra_default().ensureDirSync(tempDataFetch);
|
|
111
|
+
Object.keys(exposes).forEach((key, index)=>{
|
|
113
112
|
const expose = exposes[key];
|
|
114
113
|
if ('string' != typeof expose) return;
|
|
115
114
|
const absPath = external_path_default().resolve(process.cwd(), expose);
|
|
116
115
|
const dataFetchPath = `${absPath.replace(external_path_default().extname(absPath), '')}.data.ts`;
|
|
117
116
|
const dataFetchClientPath = `${absPath.replace(external_path_default().extname(absPath), '')}.data.client.ts`;
|
|
117
|
+
const tempFile = external_path_default().join(tempDataFetch, `data-fetch-fallback${index}.ts`);
|
|
118
|
+
external_fs_extra_default().writeFileSync(tempFile, content);
|
|
118
119
|
const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
|
|
119
120
|
if (!isServer && dateFetchClientKey) {
|
|
120
|
-
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(
|
|
121
|
+
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempFile);
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
124
|
const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
124
|
-
if (dataFetchKey && external_fs_extra_default().existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(
|
|
125
|
+
if (dataFetchKey && external_fs_extra_default().existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempFile);
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
function mergeStats(browserStats, nodeStats) {
|
package/dist/index.mjs
CHANGED
|
@@ -58,23 +58,24 @@ const addExcludeDtsSuffix = (filepath)=>`${filepath}?exclude-mf-dts=true`;
|
|
|
58
58
|
function addDataFetchExposes(exposes, isServer) {
|
|
59
59
|
if ('object' != typeof exposes || Array.isArray(exposes)) return;
|
|
60
60
|
if (0 === Object.keys(exposes).length) return;
|
|
61
|
-
const
|
|
61
|
+
const tempDataFetch = path.resolve(process.cwd(), `node_modules/${TEMP_DIR}`);
|
|
62
62
|
const content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
63
|
-
fs_extra.ensureDirSync(
|
|
64
|
-
|
|
65
|
-
Object.keys(exposes).forEach((key)=>{
|
|
63
|
+
fs_extra.ensureDirSync(tempDataFetch);
|
|
64
|
+
Object.keys(exposes).forEach((key, index)=>{
|
|
66
65
|
const expose = exposes[key];
|
|
67
66
|
if ('string' != typeof expose) return;
|
|
68
67
|
const absPath = path.resolve(process.cwd(), expose);
|
|
69
68
|
const dataFetchPath = `${absPath.replace(path.extname(absPath), '')}.data.ts`;
|
|
70
69
|
const dataFetchClientPath = `${absPath.replace(path.extname(absPath), '')}.data.client.ts`;
|
|
70
|
+
const tempFile = path.join(tempDataFetch, `data-fetch-fallback${index}.ts`);
|
|
71
|
+
fs_extra.writeFileSync(tempFile, content);
|
|
71
72
|
const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
|
|
72
73
|
if (!isServer && dateFetchClientKey) {
|
|
73
|
-
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(
|
|
74
|
+
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempFile);
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
77
|
const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
77
|
-
if (dataFetchKey && fs_extra.existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(
|
|
78
|
+
if (dataFetchKey && fs_extra.existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempFile);
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
function mergeStats(browserStats, nodeStats) {
|
package/dist/utils.js
CHANGED
|
@@ -105,23 +105,24 @@ const addExcludeDtsSuffix = (filepath)=>`${filepath}?exclude-mf-dts=true`;
|
|
|
105
105
|
function addDataFetchExposes(exposes, isServer) {
|
|
106
106
|
if ('object' != typeof exposes || Array.isArray(exposes)) return;
|
|
107
107
|
if (0 === Object.keys(exposes).length) return;
|
|
108
|
-
const
|
|
108
|
+
const tempDataFetch = external_path_default().resolve(process.cwd(), `node_modules/${sdk_namespaceObject.TEMP_DIR}`);
|
|
109
109
|
const content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
110
|
-
external_fs_extra_default().ensureDirSync(
|
|
111
|
-
|
|
112
|
-
Object.keys(exposes).forEach((key)=>{
|
|
110
|
+
external_fs_extra_default().ensureDirSync(tempDataFetch);
|
|
111
|
+
Object.keys(exposes).forEach((key, index)=>{
|
|
113
112
|
const expose = exposes[key];
|
|
114
113
|
if ('string' != typeof expose) return;
|
|
115
114
|
const absPath = external_path_default().resolve(process.cwd(), expose);
|
|
116
115
|
const dataFetchPath = `${absPath.replace(external_path_default().extname(absPath), '')}.data.ts`;
|
|
117
116
|
const dataFetchClientPath = `${absPath.replace(external_path_default().extname(absPath), '')}.data.client.ts`;
|
|
117
|
+
const tempFile = external_path_default().join(tempDataFetch, `data-fetch-fallback${index}.ts`);
|
|
118
|
+
external_fs_extra_default().writeFileSync(tempFile, content);
|
|
118
119
|
const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
|
|
119
120
|
if (!isServer && dateFetchClientKey) {
|
|
120
|
-
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(
|
|
121
|
+
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempFile);
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
124
|
const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
124
|
-
if (dataFetchKey && external_fs_extra_default().existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(
|
|
125
|
+
if (dataFetchKey && external_fs_extra_default().existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempFile);
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
function mergeStats(browserStats, nodeStats) {
|
package/dist/utils.mjs
CHANGED
|
@@ -53,23 +53,24 @@ const addExcludeDtsSuffix = (filepath)=>`${filepath}?exclude-mf-dts=true`;
|
|
|
53
53
|
function addDataFetchExposes(exposes, isServer) {
|
|
54
54
|
if ('object' != typeof exposes || Array.isArray(exposes)) return;
|
|
55
55
|
if (0 === Object.keys(exposes).length) return;
|
|
56
|
-
const
|
|
56
|
+
const tempDataFetch = path.resolve(process.cwd(), `node_modules/${TEMP_DIR}`);
|
|
57
57
|
const content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
58
|
-
fs_extra.ensureDirSync(
|
|
59
|
-
|
|
60
|
-
Object.keys(exposes).forEach((key)=>{
|
|
58
|
+
fs_extra.ensureDirSync(tempDataFetch);
|
|
59
|
+
Object.keys(exposes).forEach((key, index)=>{
|
|
61
60
|
const expose = exposes[key];
|
|
62
61
|
if ('string' != typeof expose) return;
|
|
63
62
|
const absPath = path.resolve(process.cwd(), expose);
|
|
64
63
|
const dataFetchPath = `${absPath.replace(path.extname(absPath), '')}.data.ts`;
|
|
65
64
|
const dataFetchClientPath = `${absPath.replace(path.extname(absPath), '')}.data.client.ts`;
|
|
65
|
+
const tempFile = path.join(tempDataFetch, `data-fetch-fallback${index}.ts`);
|
|
66
|
+
fs_extra.writeFileSync(tempFile, content);
|
|
66
67
|
const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
|
|
67
68
|
if (!isServer && dateFetchClientKey) {
|
|
68
|
-
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(
|
|
69
|
+
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempFile);
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
72
|
const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
72
|
-
if (dataFetchKey && fs_extra.existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(
|
|
73
|
+
if (dataFetchKey && fs_extra.existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempFile);
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
76
|
function mergeStats(browserStats, nodeStats) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/rsbuild-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Module Federation plugin for Rsbuild",
|
|
5
5
|
"homepage": "https://module-federation.io",
|
|
6
6
|
"bugs": {
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"fs-extra": "11.3.0",
|
|
53
|
-
"@module-federation/
|
|
54
|
-
"@module-federation/node": "2.7.
|
|
55
|
-
"@module-federation/
|
|
53
|
+
"@module-federation/sdk": "0.22.0",
|
|
54
|
+
"@module-federation/node": "2.7.26",
|
|
55
|
+
"@module-federation/enhanced": "0.22.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@rslib/core": "^0.12.4",
|