@module-federation/rsbuild-plugin 2.3.1 → 2.3.2

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.
@@ -56,9 +56,9 @@ __webpack_require__.d(__webpack_exports__, {
56
56
  addDataFetchExposes: () => (/* binding */ addDataFetchExposes)
57
57
  });
58
58
 
59
- ;// CONCATENATED MODULE: external "fs-extra"
60
- const external_fs_extra_namespaceObject = require("fs-extra");
61
- var external_fs_extra_default = /*#__PURE__*/__webpack_require__.n(external_fs_extra_namespaceObject);
59
+ ;// CONCATENATED MODULE: external "fs"
60
+ const external_fs_namespaceObject = require("fs");
61
+ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_namespaceObject);
62
62
  ;// CONCATENATED MODULE: external "path"
63
63
  const external_path_namespaceObject = require("path");
64
64
  var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_namespaceObject);
@@ -72,7 +72,7 @@ const external_constant_js_namespaceObject = require("../constant.js");
72
72
 
73
73
 
74
74
  const addDataFetchExpose = (exposes, key, filepath, suffix = '')=>{
75
- if (!external_fs_extra_default().existsSync(filepath)) {
75
+ if (!external_fs_default().existsSync(filepath)) {
76
76
  return false;
77
77
  }
78
78
  const dataFetchKey = key === '.' ? `./${external_constant_js_namespaceObject.DATA_FETCH_IDENTIFIER}${suffix}` : `${key}.${external_constant_js_namespaceObject.DATA_FETCH_IDENTIFIER}${suffix}`;
@@ -94,7 +94,9 @@ function addDataFetchExposes(exposes, isServer) {
94
94
  }
95
95
  const tempDataFetch = external_path_default().resolve(process.cwd(), `node_modules/${sdk_namespaceObject.TEMP_DIR}`);
96
96
  const content = `export const fetchData=()=>{throw new Error('should not be called')};`;
97
- external_fs_extra_default().ensureDirSync(tempDataFetch);
97
+ external_fs_default().mkdirSync(tempDataFetch, {
98
+ recursive: true
99
+ });
98
100
  Object.keys(exposes).forEach((key, index)=>{
99
101
  const expose = exposes[key];
100
102
  if (typeof expose !== 'string') {
@@ -104,14 +106,14 @@ function addDataFetchExposes(exposes, isServer) {
104
106
  const dataFetchPath = `${absPath.replace(external_path_default().extname(absPath), '')}.${external_constant_js_namespaceObject.DATA_FETCH_IDENTIFIER}.ts`;
105
107
  const dataFetchClientPath = `${absPath.replace(external_path_default().extname(absPath), '')}.${external_constant_js_namespaceObject.DATA_FETCH_IDENTIFIER}.client.ts`;
106
108
  const tempFile = external_path_default().join(tempDataFetch, `data-fetch-fallback${index}.ts`);
107
- external_fs_extra_default().writeFileSync(tempFile, content);
109
+ external_fs_default().writeFileSync(tempFile, content);
108
110
  const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, external_constant_js_namespaceObject.DATA_FETCH_CLIENT_SUFFIX);
109
111
  if (!isServer && dateFetchClientKey) {
110
112
  exposes[dateFetchClientKey.replace(external_constant_js_namespaceObject.DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempFile);
111
113
  return;
112
114
  }
113
115
  const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
114
- if (dataFetchKey && external_fs_extra_default().existsSync(dataFetchClientPath)) {
116
+ if (dataFetchKey && external_fs_default().existsSync(dataFetchClientPath)) {
115
117
  exposes[`${dataFetchKey}${external_constant_js_namespaceObject.DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempFile);
116
118
  }
117
119
  });
@@ -1,9 +1,9 @@
1
- import fs_extra from "fs-extra";
1
+ import fs from "fs";
2
2
  import path from "path";
3
3
  import { TEMP_DIR } from "@module-federation/sdk";
4
4
  import { DATA_FETCH_CLIENT_SUFFIX, DATA_FETCH_IDENTIFIER } from "../constant.mjs";
5
5
 
6
- ;// CONCATENATED MODULE: external "fs-extra"
6
+ ;// CONCATENATED MODULE: external "fs"
7
7
 
8
8
  ;// CONCATENATED MODULE: external "path"
9
9
 
@@ -17,7 +17,7 @@ import { DATA_FETCH_CLIENT_SUFFIX, DATA_FETCH_IDENTIFIER } from "../constant.mjs
17
17
 
18
18
 
19
19
  const addDataFetchExpose = (exposes, key, filepath, suffix = '')=>{
20
- if (!fs_extra.existsSync(filepath)) {
20
+ if (!fs.existsSync(filepath)) {
21
21
  return false;
22
22
  }
23
23
  const dataFetchKey = key === '.' ? `./${DATA_FETCH_IDENTIFIER}${suffix}` : `${key}.${DATA_FETCH_IDENTIFIER}${suffix}`;
@@ -39,7 +39,9 @@ function addDataFetchExposes(exposes, isServer) {
39
39
  }
40
40
  const tempDataFetch = path.resolve(process.cwd(), `node_modules/${TEMP_DIR}`);
41
41
  const content = `export const fetchData=()=>{throw new Error('should not be called')};`;
42
- fs_extra.ensureDirSync(tempDataFetch);
42
+ fs.mkdirSync(tempDataFetch, {
43
+ recursive: true
44
+ });
43
45
  Object.keys(exposes).forEach((key, index)=>{
44
46
  const expose = exposes[key];
45
47
  if (typeof expose !== 'string') {
@@ -49,14 +51,14 @@ function addDataFetchExposes(exposes, isServer) {
49
51
  const dataFetchPath = `${absPath.replace(path.extname(absPath), '')}.${DATA_FETCH_IDENTIFIER}.ts`;
50
52
  const dataFetchClientPath = `${absPath.replace(path.extname(absPath), '')}.${DATA_FETCH_IDENTIFIER}.client.ts`;
51
53
  const tempFile = path.join(tempDataFetch, `data-fetch-fallback${index}.ts`);
52
- fs_extra.writeFileSync(tempFile, content);
54
+ fs.writeFileSync(tempFile, content);
53
55
  const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
54
56
  if (!isServer && dateFetchClientKey) {
55
57
  exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempFile);
56
58
  return;
57
59
  }
58
60
  const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
59
- if (dataFetchKey && fs_extra.existsSync(dataFetchClientPath)) {
61
+ if (dataFetchKey && fs.existsSync(dataFetchClientPath)) {
60
62
  exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempFile);
61
63
  }
62
64
  });
@@ -59,9 +59,9 @@ __webpack_require__.d(__webpack_exports__, {
59
59
  ;// CONCATENATED MODULE: external "path"
60
60
  const external_path_namespaceObject = require("path");
61
61
  var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_namespaceObject);
62
- ;// CONCATENATED MODULE: external "fs-extra"
63
- const external_fs_extra_namespaceObject = require("fs-extra");
64
- var external_fs_extra_default = /*#__PURE__*/__webpack_require__.n(external_fs_extra_namespaceObject);
62
+ ;// CONCATENATED MODULE: external "fs"
63
+ const external_fs_namespaceObject = require("fs");
64
+ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_namespaceObject);
65
65
  ;// CONCATENATED MODULE: ./src/utils/manifest.ts
66
66
 
67
67
 
@@ -100,8 +100,8 @@ function mergeStatsAndManifest(nodeAssets, browserAssets) {
100
100
  }
101
101
  function updateStatsAndManifest(nodeAssets, browserAssets, outputDir) {
102
102
  const { mergedStats, mergedStatsFilePath, mergedManifest, mergedManifestFilePath } = mergeStatsAndManifest(nodeAssets, browserAssets);
103
- external_fs_extra_default().writeFileSync(external_path_default().resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
104
- external_fs_extra_default().writeFileSync(external_path_default().resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
103
+ external_fs_default().writeFileSync(external_path_default().resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
104
+ external_fs_default().writeFileSync(external_path_default().resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
105
105
  }
106
106
 
107
107
  exports.updateStatsAndManifest = __webpack_exports__.updateStatsAndManifest;
@@ -1,9 +1,9 @@
1
1
  import path from "path";
2
- import fs_extra from "fs-extra";
2
+ import fs from "fs";
3
3
 
4
4
  ;// CONCATENATED MODULE: external "path"
5
5
 
6
- ;// CONCATENATED MODULE: external "fs-extra"
6
+ ;// CONCATENATED MODULE: external "fs"
7
7
 
8
8
  ;// CONCATENATED MODULE: ./src/utils/manifest.ts
9
9
 
@@ -43,8 +43,8 @@ function mergeStatsAndManifest(nodeAssets, browserAssets) {
43
43
  }
44
44
  function updateStatsAndManifest(nodeAssets, browserAssets, outputDir) {
45
45
  const { mergedStats, mergedStatsFilePath, mergedManifest, mergedManifestFilePath } = mergeStatsAndManifest(nodeAssets, browserAssets);
46
- fs_extra.writeFileSync(path.resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
47
- fs_extra.writeFileSync(path.resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
46
+ fs.writeFileSync(path.resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
47
+ fs.writeFileSync(path.resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
48
48
  }
49
49
 
50
50
  export { updateStatsAndManifest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/rsbuild-plugin",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "Module Federation plugin for Rsbuild",
5
5
  "homepage": "https://module-federation.io",
6
6
  "bugs": {
@@ -49,10 +49,9 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "fs-extra": "11.3.0",
53
- "@module-federation/sdk": "2.3.1",
54
- "@module-federation/node": "2.7.39",
55
- "@module-federation/enhanced": "2.3.1"
52
+ "@module-federation/sdk": "2.3.2",
53
+ "@module-federation/enhanced": "2.3.2",
54
+ "@module-federation/node": "2.7.40"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@rslib/core": "^0.12.4",