@module-federation/rsbuild-plugin 0.19.0 → 0.20.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/constant.d.ts +9 -1
- package/dist/constant.js +59 -0
- package/dist/constant.mjs +10 -0
- package/dist/index.js +439 -0
- package/dist/index.mjs +375 -0
- package/dist/{src/utils → utils}/ssr.d.ts +1 -1
- package/dist/utils.js +264 -0
- package/dist/utils.mjs +186 -0
- package/package.json +18 -17
- package/dist/constant.cjs.js +0 -19
- package/dist/constant.cjs.js.map +0 -1
- package/dist/constant.esm.d.ts +0 -1
- package/dist/constant.esm.mjs +0 -12
- package/dist/constant.esm.mjs.map +0 -1
- package/dist/index.cjs.js +0 -360
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.d.ts +0 -1
- package/dist/index.esm.mjs +0 -349
- package/dist/index.esm.mjs.map +0 -1
- package/dist/src/constant.d.ts +0 -9
- package/dist/utils.cjs.js +0 -329
- package/dist/utils.cjs.js.map +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.esm.d.ts +0 -1
- package/dist/utils.esm.mjs +0 -317
- package/dist/utils.esm.mjs.map +0 -1
- /package/dist/{src/cli → cli}/index.d.ts +0 -0
- /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
- /package/dist/{src/utils → utils}/addDataFetchExposes.d.ts +0 -0
- /package/dist/{src/utils → utils}/autoDeleteSplitChunkCacheGroups.d.ts +0 -0
- /package/dist/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/{src/utils → utils}/manifest.d.ts +0 -0
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import util from "util";
|
|
2
|
+
import fs_extra from "fs-extra";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { TEMP_DIR, encodeName } from "@module-federation/sdk";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
|
+
const DATA_FETCH_CLIENT_SUFFIX = '.client';
|
|
7
|
+
const CALL_NAME_MAP = {
|
|
8
|
+
RSPRESS: 'rspress',
|
|
9
|
+
RSLIB: 'rslib'
|
|
10
|
+
};
|
|
11
|
+
const SPLIT_CHUNK_MAP = {
|
|
12
|
+
REACT: 'react',
|
|
13
|
+
ROUTER: 'router',
|
|
14
|
+
LODASH: 'lib-lodash',
|
|
15
|
+
ANTD: 'lib-antd',
|
|
16
|
+
ARCO: 'lib-arco',
|
|
17
|
+
SEMI: 'lib-semi',
|
|
18
|
+
AXIOS: 'lib-axios'
|
|
19
|
+
};
|
|
20
|
+
const SHARED_SPLIT_CHUNK_MAP = {
|
|
21
|
+
react: SPLIT_CHUNK_MAP.REACT,
|
|
22
|
+
'react-dom': SPLIT_CHUNK_MAP.REACT,
|
|
23
|
+
'react-router': SPLIT_CHUNK_MAP.ROUTER,
|
|
24
|
+
'react-router-dom': SPLIT_CHUNK_MAP.ROUTER,
|
|
25
|
+
'@remix-run/router': SPLIT_CHUNK_MAP.ROUTER,
|
|
26
|
+
lodash: SPLIT_CHUNK_MAP.LODASH,
|
|
27
|
+
'lodash-es': SPLIT_CHUNK_MAP.LODASH,
|
|
28
|
+
antd: SPLIT_CHUNK_MAP.ANTD,
|
|
29
|
+
'@arco-design/web-react': SPLIT_CHUNK_MAP.ARCO,
|
|
30
|
+
'@douyinfe/semi-ui': SPLIT_CHUNK_MAP.SEMI,
|
|
31
|
+
axios: SPLIT_CHUNK_MAP.AXIOS
|
|
32
|
+
};
|
|
33
|
+
function autoDeleteSplitChunkCacheGroups(mfConfig, splitChunks) {
|
|
34
|
+
if (!mfConfig.shared) return;
|
|
35
|
+
if (!splitChunks || !(null == splitChunks ? void 0 : splitChunks.cacheGroups)) return;
|
|
36
|
+
const arrayShared = Array.isArray(mfConfig.shared) ? mfConfig.shared : Object.keys(mfConfig.shared);
|
|
37
|
+
for (const shared of arrayShared){
|
|
38
|
+
const splitChunkKey = SHARED_SPLIT_CHUNK_MAP[shared];
|
|
39
|
+
if (splitChunkKey) {
|
|
40
|
+
if (splitChunks.cacheGroups[splitChunkKey]) delete splitChunks.cacheGroups[splitChunkKey];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return splitChunks;
|
|
44
|
+
}
|
|
45
|
+
const addDataFetchExpose = (exposes, key, filepath, suffix = '')=>{
|
|
46
|
+
if (!fs_extra.existsSync(filepath)) return false;
|
|
47
|
+
const dataFetchKey = '.' === key ? `./data${suffix}` : `${key}.data${suffix}`;
|
|
48
|
+
if (exposes[dataFetchKey] && exposes[dataFetchKey] !== filepath) throw new Error(`data fetch key ${dataFetchKey} already exists, please modify this expose key, do not end with 'data' or '${DATA_FETCH_CLIENT_SUFFIX}'`);
|
|
49
|
+
exposes[dataFetchKey] = filepath;
|
|
50
|
+
return dataFetchKey;
|
|
51
|
+
};
|
|
52
|
+
const addExcludeDtsSuffix = (filepath)=>`${filepath}?exclude-mf-dts=true`;
|
|
53
|
+
function addDataFetchExposes(exposes, isServer) {
|
|
54
|
+
if ('object' != typeof exposes || Array.isArray(exposes)) return;
|
|
55
|
+
if (0 === Object.keys(exposes).length) return;
|
|
56
|
+
const tempDataFetchFilepath = path.resolve(process.cwd(), `node_modules/${TEMP_DIR}/data-fetch-fallback.ts`);
|
|
57
|
+
const content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
58
|
+
fs_extra.ensureDirSync(path.dirname(tempDataFetchFilepath));
|
|
59
|
+
fs_extra.writeFileSync(tempDataFetchFilepath, content);
|
|
60
|
+
Object.keys(exposes).forEach((key)=>{
|
|
61
|
+
const expose = exposes[key];
|
|
62
|
+
if ('string' != typeof expose) return;
|
|
63
|
+
const absPath = path.resolve(process.cwd(), expose);
|
|
64
|
+
const dataFetchPath = `${absPath.replace(path.extname(absPath), '')}.data.ts`;
|
|
65
|
+
const dataFetchClientPath = `${absPath.replace(path.extname(absPath), '')}.data.client.ts`;
|
|
66
|
+
const dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
|
|
67
|
+
if (!isServer && dateFetchClientKey) {
|
|
68
|
+
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempDataFetchFilepath);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
72
|
+
if (dataFetchKey && fs_extra.existsSync(dataFetchClientPath)) exposes[`${dataFetchKey}${DATA_FETCH_CLIENT_SUFFIX}`] = addExcludeDtsSuffix(tempDataFetchFilepath);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function mergeStats(browserStats, nodeStats) {
|
|
76
|
+
const ssrRemoteEntry = nodeStats.metaData.remoteEntry;
|
|
77
|
+
browserStats.metaData.ssrRemoteEntry = ssrRemoteEntry;
|
|
78
|
+
if ('publicPath' in browserStats.metaData) browserStats.metaData.ssrPublicPath = nodeStats.metaData.publicPath;
|
|
79
|
+
return browserStats;
|
|
80
|
+
}
|
|
81
|
+
function mergeManifest(browserManifest, nodeManifest) {
|
|
82
|
+
const ssrRemoteEntry = nodeManifest.metaData.remoteEntry;
|
|
83
|
+
browserManifest.metaData.ssrRemoteEntry = ssrRemoteEntry;
|
|
84
|
+
if ('publicPath' in browserManifest.metaData) browserManifest.metaData.ssrPublicPath = nodeManifest.metaData.publicPath;
|
|
85
|
+
return browserManifest;
|
|
86
|
+
}
|
|
87
|
+
function mergeStatsAndManifest(nodePlugin, browserPlugin) {
|
|
88
|
+
const nodeResourceInfo = nodePlugin.statsResourceInfo;
|
|
89
|
+
const browserResourceInfo = browserPlugin.statsResourceInfo;
|
|
90
|
+
if (!browserResourceInfo || !nodeResourceInfo || !browserResourceInfo.stats || !nodeResourceInfo.stats || !browserResourceInfo.manifest || !nodeResourceInfo.manifest) throw new Error('can not get browserResourceInfo or nodeResourceInfo');
|
|
91
|
+
const mergedStats = mergeStats(browserResourceInfo.stats.stats, nodeResourceInfo.stats.stats);
|
|
92
|
+
const mergedManifest = mergeManifest(browserResourceInfo.manifest.manifest, nodeResourceInfo.manifest.manifest);
|
|
93
|
+
return {
|
|
94
|
+
mergedStats: mergedStats,
|
|
95
|
+
mergedStatsFilePath: browserResourceInfo.stats.filename,
|
|
96
|
+
mergedManifest: mergedManifest,
|
|
97
|
+
mergedManifestFilePath: browserResourceInfo.manifest.filename
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function updateStatsAndManifest(nodePlugin, browserPlugin, outputDir) {
|
|
101
|
+
const { mergedStats, mergedStatsFilePath, mergedManifest, mergedManifestFilePath } = mergeStatsAndManifest(nodePlugin, browserPlugin);
|
|
102
|
+
fs_extra.writeFileSync(path.resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
|
|
103
|
+
fs_extra.writeFileSync(path.resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
|
|
104
|
+
}
|
|
105
|
+
const ssr_require = createRequire(import.meta.url);
|
|
106
|
+
const resolve = ssr_require.resolve;
|
|
107
|
+
const SSR_DIR = 'ssr';
|
|
108
|
+
const SSR_ENV_NAME = 'mf-ssr';
|
|
109
|
+
function setSSREnv() {
|
|
110
|
+
process.env['MF_DISABLE_EMIT_STATS'] = 'true';
|
|
111
|
+
process.env['MF_SSR_PRJ'] = 'true';
|
|
112
|
+
}
|
|
113
|
+
const isDev = ()=>'development' === process.env['NODE_ENV'];
|
|
114
|
+
function patchSSRRspackConfig(config, mfConfig, ssrDir, callerName, resetEntry = true, modifyPublicPath = true) {
|
|
115
|
+
var _config_output;
|
|
116
|
+
config.output ||= {};
|
|
117
|
+
if (modifyPublicPath) {
|
|
118
|
+
var _config_output1;
|
|
119
|
+
if ('string' != typeof (null == (_config_output1 = config.output) ? void 0 : _config_output1.publicPath)) throw new Error('publicPath must be string!');
|
|
120
|
+
const publicPath = config.output.publicPath;
|
|
121
|
+
if ('auto' === publicPath) throw new Error('publicPath can not be "auto"!');
|
|
122
|
+
const publicPathWithSSRDir = `${publicPath}${ssrDir}/`;
|
|
123
|
+
config.output.publicPath = publicPathWithSSRDir;
|
|
124
|
+
}
|
|
125
|
+
if (callerName === CALL_NAME_MAP.RSPRESS && resetEntry) config.entry = 'data:application/node;base64,';
|
|
126
|
+
config.target = 'async-node';
|
|
127
|
+
const UniverseEntryChunkTrackerPlugin = ssr_require('@module-federation/node/universe-entry-chunk-tracker-plugin').default;
|
|
128
|
+
config.plugins ||= [];
|
|
129
|
+
isDev() && config.plugins.push(new UniverseEntryChunkTrackerPlugin());
|
|
130
|
+
const uniqueName = mfConfig.name || (null == (_config_output = config.output) ? void 0 : _config_output.uniqueName);
|
|
131
|
+
const chunkFileName = config.output.chunkFilename;
|
|
132
|
+
if ('string' == typeof chunkFileName && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
133
|
+
const suffix = `${encodeName(uniqueName)}-[contenthash].js`;
|
|
134
|
+
config.output.chunkFilename = chunkFileName.replace('.js', suffix);
|
|
135
|
+
}
|
|
136
|
+
return config;
|
|
137
|
+
}
|
|
138
|
+
function createSSRREnvConfig(envConfig, mfConfig, ssrDir, rsbuildConfig, callerName) {
|
|
139
|
+
var _ssrEnvConfig_output, _ssrEnvConfig_output_distPath, _ssrEnvConfig_output1, _rsbuildConfig_output_distPath, _rsbuildConfig_output;
|
|
140
|
+
const ssrEnvConfig = {
|
|
141
|
+
...envConfig,
|
|
142
|
+
tools: {
|
|
143
|
+
rspack: (config, { environment })=>{
|
|
144
|
+
if (environment.name !== SSR_ENV_NAME) return;
|
|
145
|
+
patchSSRRspackConfig(config, mfConfig, ssrDir, callerName);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
ssrEnvConfig.output = {
|
|
150
|
+
...ssrEnvConfig.output,
|
|
151
|
+
target: 'node',
|
|
152
|
+
distPath: {
|
|
153
|
+
...null == (_ssrEnvConfig_output = ssrEnvConfig.output) ? void 0 : _ssrEnvConfig_output.distPath,
|
|
154
|
+
root: path.join((null == (_ssrEnvConfig_output1 = ssrEnvConfig.output) ? void 0 : null == (_ssrEnvConfig_output_distPath = _ssrEnvConfig_output1.distPath) ? void 0 : _ssrEnvConfig_output_distPath.root) || (null == (_rsbuildConfig_output = rsbuildConfig.output) ? void 0 : null == (_rsbuildConfig_output_distPath = _rsbuildConfig_output.distPath) ? void 0 : _rsbuildConfig_output_distPath.root) || '', ssrDir)
|
|
155
|
+
},
|
|
156
|
+
emitAssets: true
|
|
157
|
+
};
|
|
158
|
+
return ssrEnvConfig;
|
|
159
|
+
}
|
|
160
|
+
function createSSRMFConfig(mfConfig) {
|
|
161
|
+
var _mfConfig_library;
|
|
162
|
+
const ssrMFConfig = {
|
|
163
|
+
...mfConfig,
|
|
164
|
+
exposes: {
|
|
165
|
+
...mfConfig.exposes
|
|
166
|
+
},
|
|
167
|
+
library: {
|
|
168
|
+
...mfConfig.library,
|
|
169
|
+
name: mfConfig.name,
|
|
170
|
+
type: (null == (_mfConfig_library = mfConfig.library) ? void 0 : _mfConfig_library.type) ?? 'commonjs-module'
|
|
171
|
+
},
|
|
172
|
+
dts: false,
|
|
173
|
+
dev: false,
|
|
174
|
+
runtimePlugins: [
|
|
175
|
+
...mfConfig.runtimePlugins || []
|
|
176
|
+
]
|
|
177
|
+
};
|
|
178
|
+
ssrMFConfig.runtimePlugins.push(resolve('@module-federation/node/runtimePlugin'));
|
|
179
|
+
if (isDev()) ssrMFConfig.runtimePlugins.push(resolve('@module-federation/node/record-dynamic-remote-entry-hash-plugin'));
|
|
180
|
+
return ssrMFConfig;
|
|
181
|
+
}
|
|
182
|
+
function isRegExp(target) {
|
|
183
|
+
return util.types.isRegExp(target);
|
|
184
|
+
}
|
|
185
|
+
var __webpack_exports__DEFAULT_ASSET_PREFIX = "/";
|
|
186
|
+
export { SSR_DIR, SSR_ENV_NAME, addDataFetchExposes, autoDeleteSplitChunkCacheGroups, createSSRMFConfig, createSSRREnvConfig, isRegExp, patchSSRRspackConfig, setSSREnv, updateStatsAndManifest, __webpack_exports__DEFAULT_ASSET_PREFIX as DEFAULT_ASSET_PREFIX };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/rsbuild-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Module Federation plugin for Rsbuild",
|
|
5
5
|
"homepage": "https://module-federation.io",
|
|
6
6
|
"bugs": {
|
|
@@ -14,31 +14,31 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
"import": "./dist/index.
|
|
19
|
-
"require": "./dist/index.
|
|
17
|
+
"types": "./dist/cli/index.d.ts",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"require": "./dist/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./utils": {
|
|
22
|
-
"types": "./dist/utils.d.ts",
|
|
23
|
-
"import": "./dist/utils.
|
|
24
|
-
"require": "./dist/utils.
|
|
22
|
+
"types": "./dist/utils/index.d.ts",
|
|
23
|
+
"import": "./dist/utils.mjs",
|
|
24
|
+
"require": "./dist/utils.js"
|
|
25
25
|
},
|
|
26
26
|
"./constant": {
|
|
27
27
|
"types": "./dist/constant.d.ts",
|
|
28
|
-
"import": "./dist/constant.
|
|
29
|
-
"require": "./dist/constant.
|
|
28
|
+
"import": "./dist/constant.mjs",
|
|
29
|
+
"require": "./dist/constant.js"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
"main": "./dist/index.
|
|
33
|
-
"module": "./dist/index.
|
|
34
|
-
"types": "./dist/index.d.ts",
|
|
32
|
+
"main": "./dist/index.js",
|
|
33
|
+
"module": "./dist/index.mjs",
|
|
34
|
+
"types": "./dist/cli/index.d.ts",
|
|
35
35
|
"typesVersions": {
|
|
36
36
|
"*": {
|
|
37
37
|
".": [
|
|
38
|
-
"./dist/index.d.ts"
|
|
38
|
+
"./dist/cli/index.d.ts"
|
|
39
39
|
],
|
|
40
40
|
"utils": [
|
|
41
|
-
"./dist/utils.d.ts"
|
|
41
|
+
"./dist/utils/index.d.ts"
|
|
42
42
|
],
|
|
43
43
|
"constant": [
|
|
44
44
|
"./dist/constant.d.ts"
|
|
@@ -50,11 +50,12 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"fs-extra": "11.3.0",
|
|
53
|
-
"@module-federation/
|
|
54
|
-
"@module-federation/
|
|
55
|
-
"@module-federation/
|
|
53
|
+
"@module-federation/enhanced": "0.20.0",
|
|
54
|
+
"@module-federation/node": "2.7.18",
|
|
55
|
+
"@module-federation/sdk": "0.20.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
+
"@rslib/core": "^0.12.4",
|
|
58
59
|
"@rsbuild/core": "^1.3.21"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|
package/dist/constant.cjs.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var DEFAULT_ASSET_PREFIX = '/';
|
|
4
|
-
var DATA_FETCH_IDENTIFIER = 'data';
|
|
5
|
-
var DATA_FETCH_CLIENT_SUFFIX = '.client';
|
|
6
|
-
var CALL_NAME_MAP = {
|
|
7
|
-
RSPRESS: 'rspress',
|
|
8
|
-
RSLIB: 'rslib'
|
|
9
|
-
};
|
|
10
|
-
var RSPRESS_BUNDLER_CONFIG_NAME = 'node';
|
|
11
|
-
var RSPRESS_SSR_DIR = 'ssr';
|
|
12
|
-
|
|
13
|
-
exports.CALL_NAME_MAP = CALL_NAME_MAP;
|
|
14
|
-
exports.DATA_FETCH_CLIENT_SUFFIX = DATA_FETCH_CLIENT_SUFFIX;
|
|
15
|
-
exports.DATA_FETCH_IDENTIFIER = DATA_FETCH_IDENTIFIER;
|
|
16
|
-
exports.DEFAULT_ASSET_PREFIX = DEFAULT_ASSET_PREFIX;
|
|
17
|
-
exports.RSPRESS_BUNDLER_CONFIG_NAME = RSPRESS_BUNDLER_CONFIG_NAME;
|
|
18
|
-
exports.RSPRESS_SSR_DIR = RSPRESS_SSR_DIR;
|
|
19
|
-
//# sourceMappingURL=constant.cjs.js.map
|
package/dist/constant.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
package/dist/constant.esm.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/constant";
|
package/dist/constant.esm.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var DEFAULT_ASSET_PREFIX = '/';
|
|
2
|
-
var DATA_FETCH_IDENTIFIER = 'data';
|
|
3
|
-
var DATA_FETCH_CLIENT_SUFFIX = '.client';
|
|
4
|
-
var CALL_NAME_MAP = {
|
|
5
|
-
RSPRESS: 'rspress',
|
|
6
|
-
RSLIB: 'rslib'
|
|
7
|
-
};
|
|
8
|
-
var RSPRESS_BUNDLER_CONFIG_NAME = 'node';
|
|
9
|
-
var RSPRESS_SSR_DIR = 'ssr';
|
|
10
|
-
|
|
11
|
-
export { CALL_NAME_MAP, DATA_FETCH_CLIENT_SUFFIX, DATA_FETCH_IDENTIFIER, DEFAULT_ASSET_PREFIX, RSPRESS_BUNDLER_CONFIG_NAME, RSPRESS_SSR_DIR };
|
|
12
|
-
//# sourceMappingURL=constant.esm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.esm.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/index.cjs.js
DELETED
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var enhanced = require('@module-federation/enhanced');
|
|
4
|
-
var rspack = require('@module-federation/enhanced/rspack');
|
|
5
|
-
var sdk = require('@module-federation/sdk');
|
|
6
|
-
var utils = require('./utils.cjs.js');
|
|
7
|
-
var constant = require('./constant.cjs.js');
|
|
8
|
-
require('util');
|
|
9
|
-
require('fs-extra');
|
|
10
|
-
require('path');
|
|
11
|
-
require('node:module');
|
|
12
|
-
|
|
13
|
-
var name = "@module-federation/rsbuild-plugin";
|
|
14
|
-
var pkgJson = {
|
|
15
|
-
name: name};
|
|
16
|
-
|
|
17
|
-
var logger = sdk.createLogger('[ Module Federation Rsbuild Plugin ]');
|
|
18
|
-
|
|
19
|
-
function _array_like_to_array(arr, len) {
|
|
20
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
21
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
22
|
-
return arr2;
|
|
23
|
-
}
|
|
24
|
-
function _array_without_holes(arr) {
|
|
25
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
26
|
-
}
|
|
27
|
-
function _define_property(obj, key, value) {
|
|
28
|
-
if (key in obj) {
|
|
29
|
-
Object.defineProperty(obj, key, {
|
|
30
|
-
value: value,
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true
|
|
34
|
-
});
|
|
35
|
-
} else {
|
|
36
|
-
obj[key] = value;
|
|
37
|
-
}
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
40
|
-
function _iterable_to_array(iter) {
|
|
41
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
42
|
-
}
|
|
43
|
-
function _non_iterable_spread() {
|
|
44
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
45
|
-
}
|
|
46
|
-
function _object_spread(target) {
|
|
47
|
-
for(var i = 1; i < arguments.length; i++){
|
|
48
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
49
|
-
var ownKeys = Object.keys(source);
|
|
50
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
51
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
52
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
ownKeys.forEach(function(key) {
|
|
56
|
-
_define_property(target, key, source[key]);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return target;
|
|
60
|
-
}
|
|
61
|
-
function ownKeys(object, enumerableOnly) {
|
|
62
|
-
var keys = Object.keys(object);
|
|
63
|
-
if (Object.getOwnPropertySymbols) {
|
|
64
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
65
|
-
keys.push.apply(keys, symbols);
|
|
66
|
-
}
|
|
67
|
-
return keys;
|
|
68
|
-
}
|
|
69
|
-
function _object_spread_props(target, source) {
|
|
70
|
-
source = source != null ? source : {};
|
|
71
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
72
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
73
|
-
} else {
|
|
74
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
75
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return target;
|
|
79
|
-
}
|
|
80
|
-
function _to_consumable_array(arr) {
|
|
81
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
82
|
-
}
|
|
83
|
-
function _type_of(obj) {
|
|
84
|
-
"@swc/helpers - typeof";
|
|
85
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
86
|
-
}
|
|
87
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
88
|
-
if (!o) return;
|
|
89
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
90
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
91
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
92
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
93
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
94
|
-
}
|
|
95
|
-
var RSBUILD_PLUGIN_MODULE_FEDERATION_NAME = 'rsbuild:module-federation-enhanced';
|
|
96
|
-
var RSBUILD_PLUGIN_NAME = '@module-federation/rsbuild-plugin';
|
|
97
|
-
var LIB_FORMAT = [
|
|
98
|
-
'umd',
|
|
99
|
-
'modern-module'
|
|
100
|
-
];
|
|
101
|
-
var DEFAULT_MF_ENVIRONMENT_NAME = 'mf';
|
|
102
|
-
function isStoryBook(rsbuildConfig) {
|
|
103
|
-
var _rsbuildConfig_plugins;
|
|
104
|
-
if ((_rsbuildConfig_plugins = rsbuildConfig.plugins) === null || _rsbuildConfig_plugins === void 0 ? void 0 : _rsbuildConfig_plugins.find(function(p) {
|
|
105
|
-
return p && 'name' in p && p.name === 'module-federation-storybook-plugin';
|
|
106
|
-
})) {
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
function isMFFormat(bundlerConfig) {
|
|
112
|
-
var _bundlerConfig_output;
|
|
113
|
-
var library = (_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.library;
|
|
114
|
-
if (bundlerConfig.name === utils.SSR_ENV_NAME) {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
return !((typeof library === "undefined" ? "undefined" : _type_of(library)) === 'object' && !Array.isArray(library) && 'type' in library && (LIB_FORMAT.includes(library.type) || /commonjs/.test(library.type)));
|
|
118
|
-
}
|
|
119
|
-
var isSSRConfig = function(bundlerConfigName) {
|
|
120
|
-
return Boolean(bundlerConfigName === utils.SSR_ENV_NAME);
|
|
121
|
-
};
|
|
122
|
-
var isRspressSSGConfig = function(bundlerConfigName) {
|
|
123
|
-
return bundlerConfigName === constant.RSPRESS_BUNDLER_CONFIG_NAME;
|
|
124
|
-
};
|
|
125
|
-
var pluginModuleFederation = function(moduleFederationOptions, rsbuildOptions) {
|
|
126
|
-
return {
|
|
127
|
-
name: RSBUILD_PLUGIN_MODULE_FEDERATION_NAME,
|
|
128
|
-
setup: function(api) {
|
|
129
|
-
var _ref = rsbuildOptions || {}, _ref_ssr = _ref.ssr, ssr = _ref_ssr === void 0 ? undefined : _ref_ssr, _ref_ssrDir = _ref.ssrDir, ssrDir = _ref_ssrDir === void 0 ? utils.SSR_DIR : _ref_ssrDir, _ref_environment = _ref.environment, environment = _ref_environment === void 0 ? DEFAULT_MF_ENVIRONMENT_NAME : _ref_environment;
|
|
130
|
-
var callerName = api.context.callerName;
|
|
131
|
-
var originalRsbuildConfig = api.getRsbuildConfig();
|
|
132
|
-
if (!callerName) {
|
|
133
|
-
throw new Error('`callerName` is undefined. Please ensure the @rsbuild/core version is higher than 1.3.21 .');
|
|
134
|
-
}
|
|
135
|
-
var isRslib = callerName === constant.CALL_NAME_MAP.RSLIB;
|
|
136
|
-
var isRspress = callerName === constant.CALL_NAME_MAP.RSPRESS;
|
|
137
|
-
var isSSR = Boolean(ssr);
|
|
138
|
-
if (isSSR && !isStoryBook(originalRsbuildConfig)) {
|
|
139
|
-
var _rsbuildConfig_environments;
|
|
140
|
-
if (!isRslib && !isRspress) {
|
|
141
|
-
throw new Error("'ssr' option is only supported in rslib.");
|
|
142
|
-
}
|
|
143
|
-
var rsbuildConfig = api.getRsbuildConfig();
|
|
144
|
-
if (!((_rsbuildConfig_environments = rsbuildConfig.environments) === null || _rsbuildConfig_environments === void 0 ? void 0 : _rsbuildConfig_environments[environment]) || Object.keys(rsbuildConfig.environments).some(function(key) {
|
|
145
|
-
return key.startsWith(environment) && key !== environment;
|
|
146
|
-
})) {
|
|
147
|
-
throw new Error("Please set ".concat(RSBUILD_PLUGIN_NAME, " as global plugin in rslib.config.ts if you set 'ssr:true' ."));
|
|
148
|
-
}
|
|
149
|
-
utils.setSSREnv();
|
|
150
|
-
}
|
|
151
|
-
var sharedOptions = enhanced.parseOptions(moduleFederationOptions.shared || [], function(item, key) {
|
|
152
|
-
if (typeof item !== 'string') throw new Error('Unexpected array in shared');
|
|
153
|
-
var config = item === key || !sdk.isRequiredVersion(item) ? {
|
|
154
|
-
import: item
|
|
155
|
-
} : {
|
|
156
|
-
import: key,
|
|
157
|
-
requiredVersion: item
|
|
158
|
-
};
|
|
159
|
-
return config;
|
|
160
|
-
}, function(item, key) {
|
|
161
|
-
return item;
|
|
162
|
-
});
|
|
163
|
-
var shared = sharedOptions.map(function(shared) {
|
|
164
|
-
return shared[0].endsWith('/') ? shared[0].slice(0, -1) : shared[0];
|
|
165
|
-
});
|
|
166
|
-
api.modifyRsbuildConfig(function(config) {
|
|
167
|
-
if (isStoryBook(config)) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
if (moduleFederationOptions.exposes) {
|
|
171
|
-
var _userConfig_server, _config_server, _config_dev_client, _originalConfig_dev, _config_server1;
|
|
172
|
-
var _config, _config1, _config_server2;
|
|
173
|
-
(_config = config).dev || (_config.dev = {});
|
|
174
|
-
(_config1 = config).server || (_config1.server = {});
|
|
175
|
-
var userConfig = api.getRsbuildConfig('original');
|
|
176
|
-
(_config_server2 = config.server).headers || (_config_server2.headers = {});
|
|
177
|
-
if (!config.server.headers['Access-Control-Allow-Origin'] && !(_type_of((_userConfig_server = userConfig.server) === null || _userConfig_server === void 0 ? void 0 : _userConfig_server.cors) === 'object' && userConfig.server.cors.origin)) {
|
|
178
|
-
var corsWarnMsgs = [
|
|
179
|
-
'Detect that CORS options are not set, mf Rsbuild plugin will add default cors header: server.headers["Access-Control-Allow-Headers"] = "*". It is recommended to specify an allowlist of trusted origins in "server.cors" instead.',
|
|
180
|
-
'View https://module-federation.io/guide/troubleshooting/other.html#cors-warn for more details.'
|
|
181
|
-
];
|
|
182
|
-
!isRslib && !isRspress && logger.warn(corsWarnMsgs.join('\n'));
|
|
183
|
-
config.server.headers['Access-Control-Allow-Origin'] = '*';
|
|
184
|
-
}
|
|
185
|
-
if (((_config_server = config.server) === null || _config_server === void 0 ? void 0 : _config_server.port) && !((_config_dev_client = config.dev.client) === null || _config_dev_client === void 0 ? void 0 : _config_dev_client.port)) {
|
|
186
|
-
var _config_dev;
|
|
187
|
-
(_config_dev = config.dev).client || (_config_dev.client = {});
|
|
188
|
-
config.dev.client.port = config.server.port;
|
|
189
|
-
}
|
|
190
|
-
var originalConfig = api.getRsbuildConfig('original');
|
|
191
|
-
if (((_originalConfig_dev = originalConfig.dev) === null || _originalConfig_dev === void 0 ? void 0 : _originalConfig_dev.assetPrefix) === undefined && config.dev.assetPrefix === ((_config_server1 = config.server) === null || _config_server1 === void 0 ? void 0 : _config_server1.base)) {
|
|
192
|
-
config.dev.assetPrefix = true;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (isSSR) {
|
|
196
|
-
var _config_environments, _config_environments1;
|
|
197
|
-
if ((_config_environments = config.environments) === null || _config_environments === void 0 ? void 0 : _config_environments[utils.SSR_ENV_NAME]) {
|
|
198
|
-
throw new Error("'".concat(utils.SSR_ENV_NAME, "' environment is already defined. Please use another name."));
|
|
199
|
-
}
|
|
200
|
-
config.environments[utils.SSR_ENV_NAME] = utils.createSSRREnvConfig((_config_environments1 = config.environments) === null || _config_environments1 === void 0 ? void 0 : _config_environments1[environment], moduleFederationOptions, ssrDir, config, callerName);
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
api.modifyEnvironmentConfig(function(config) {
|
|
204
|
-
config.source.include = _to_consumable_array(config.source.include || []).concat([
|
|
205
|
-
/@module-federation\/webpack-bundler-runtime/,
|
|
206
|
-
/@module-federation\/runtime/,
|
|
207
|
-
/@module-federation\/runtime-core/,
|
|
208
|
-
/@module-federation\/sdk/
|
|
209
|
-
]);
|
|
210
|
-
return config;
|
|
211
|
-
});
|
|
212
|
-
var generateMergedStatsAndManifestOptions = {
|
|
213
|
-
options: {
|
|
214
|
-
nodePlugin: undefined,
|
|
215
|
-
browserPlugin: undefined,
|
|
216
|
-
distOutputDir: undefined
|
|
217
|
-
},
|
|
218
|
-
isSSRConfig: isSSRConfig,
|
|
219
|
-
isRspressSSGConfig: isRspressSSGConfig
|
|
220
|
-
};
|
|
221
|
-
api.expose(RSBUILD_PLUGIN_MODULE_FEDERATION_NAME, generateMergedStatsAndManifestOptions);
|
|
222
|
-
api.onBeforeCreateCompiler(function(param) {
|
|
223
|
-
var bundlerConfigs = param.bundlerConfigs;
|
|
224
|
-
if (!bundlerConfigs) {
|
|
225
|
-
throw new Error('Can not get bundlerConfigs!');
|
|
226
|
-
}
|
|
227
|
-
bundlerConfigs.forEach(function(bundlerConfig) {
|
|
228
|
-
if (!isMFFormat(bundlerConfig) && !isRspress) {
|
|
229
|
-
return;
|
|
230
|
-
} else if (isStoryBook(originalRsbuildConfig)) {
|
|
231
|
-
bundlerConfig.output.uniqueName = "".concat(moduleFederationOptions.name, "-storybook-host");
|
|
232
|
-
} else {
|
|
233
|
-
var _bundlerConfig_optimization, _bundlerConfig_optimization1, _bundlerConfig_output, _bundlerConfig_output1;
|
|
234
|
-
utils.autoDeleteSplitChunkCacheGroups(moduleFederationOptions, bundlerConfig === null || bundlerConfig === void 0 ? void 0 : (_bundlerConfig_optimization = bundlerConfig.optimization) === null || _bundlerConfig_optimization === void 0 ? void 0 : _bundlerConfig_optimization.splitChunks);
|
|
235
|
-
utils.addDataFetchExposes(moduleFederationOptions.exposes, isSSRConfig(bundlerConfig.name));
|
|
236
|
-
(_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? true : delete _bundlerConfig_optimization1.runtimeChunk;
|
|
237
|
-
var externals = bundlerConfig.externals;
|
|
238
|
-
if (Array.isArray(externals)) {
|
|
239
|
-
var sharedModules = new Set();
|
|
240
|
-
bundlerConfig.externals = externals.filter(function(ext) {
|
|
241
|
-
var sharedModule;
|
|
242
|
-
if (utils.isRegExp(ext)) {
|
|
243
|
-
var match = shared.some(function(dep) {
|
|
244
|
-
if (ext.test(dep) || ext.test(pkgJson.name)) {
|
|
245
|
-
sharedModule = dep;
|
|
246
|
-
return true;
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
249
|
-
});
|
|
250
|
-
match && sharedModule && sharedModules.add(sharedModule);
|
|
251
|
-
return !match;
|
|
252
|
-
}
|
|
253
|
-
if (typeof ext === 'string') {
|
|
254
|
-
if (ext === pkgJson.name) {
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
var match1 = shared.some(function(dep) {
|
|
258
|
-
if (dep === ext) {
|
|
259
|
-
sharedModule = dep;
|
|
260
|
-
}
|
|
261
|
-
return dep === ext;
|
|
262
|
-
});
|
|
263
|
-
if (match1) {
|
|
264
|
-
sharedModule && sharedModules.add(sharedModule);
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
return true;
|
|
270
|
-
});
|
|
271
|
-
if (sharedModules.size > 0) {
|
|
272
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
273
|
-
try {
|
|
274
|
-
for(var _iterator = sharedModules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
275
|
-
var sharedModule = _step.value;
|
|
276
|
-
logger.log("".concat(sharedModule, " is removed from externals because it is a shared module."));
|
|
277
|
-
}
|
|
278
|
-
} catch (err) {
|
|
279
|
-
_didIteratorError = true;
|
|
280
|
-
_iteratorError = err;
|
|
281
|
-
} finally{
|
|
282
|
-
try {
|
|
283
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
284
|
-
_iterator.return();
|
|
285
|
-
}
|
|
286
|
-
} finally{
|
|
287
|
-
if (_didIteratorError) {
|
|
288
|
-
throw _iteratorError;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
if (!((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.chunkLoadingGlobal) && !isSSRConfig(bundlerConfig.name) && !isRspressSSGConfig(bundlerConfig.name)) {
|
|
295
|
-
bundlerConfig.output.chunkLoading = 'jsonp';
|
|
296
|
-
bundlerConfig.output.chunkLoadingGlobal = "chunk_".concat(moduleFederationOptions.name);
|
|
297
|
-
}
|
|
298
|
-
if (!((_bundlerConfig_output1 = bundlerConfig.output) === null || _bundlerConfig_output1 === void 0 ? void 0 : _bundlerConfig_output1.uniqueName)) {
|
|
299
|
-
bundlerConfig.output.uniqueName = moduleFederationOptions.name;
|
|
300
|
-
}
|
|
301
|
-
if (!bundlerConfig.plugins.find(function(p) {
|
|
302
|
-
return p && p.name === rspack.PLUGIN_NAME;
|
|
303
|
-
})) {
|
|
304
|
-
var _bundlerConfig_output2;
|
|
305
|
-
if (isSSRConfig(bundlerConfig.name)) {
|
|
306
|
-
generateMergedStatsAndManifestOptions.options.nodePlugin = new rspack.ModuleFederationPlugin(utils.createSSRMFConfig(moduleFederationOptions));
|
|
307
|
-
bundlerConfig.plugins.push(generateMergedStatsAndManifestOptions.options.nodePlugin);
|
|
308
|
-
return;
|
|
309
|
-
} else if (isRspressSSGConfig(bundlerConfig.name)) {
|
|
310
|
-
var _bundlerConfig;
|
|
311
|
-
var mfConfig = _object_spread_props(_object_spread({}, utils.createSSRMFConfig(moduleFederationOptions)), {
|
|
312
|
-
exposes: {},
|
|
313
|
-
manifest: false,
|
|
314
|
-
library: undefined
|
|
315
|
-
});
|
|
316
|
-
utils.patchSSRRspackConfig(bundlerConfig, mfConfig, constant.RSPRESS_SSR_DIR, callerName, false, false);
|
|
317
|
-
(_bundlerConfig = bundlerConfig).output || (_bundlerConfig.output = {});
|
|
318
|
-
bundlerConfig.output.publicPath = '/';
|
|
319
|
-
bundlerConfig.output.asyncChunks = undefined;
|
|
320
|
-
generateMergedStatsAndManifestOptions.options.rspressSSGPlugin = new rspack.ModuleFederationPlugin(mfConfig);
|
|
321
|
-
bundlerConfig.plugins.push(generateMergedStatsAndManifestOptions.options.rspressSSGPlugin);
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
generateMergedStatsAndManifestOptions.options.browserPlugin = new rspack.ModuleFederationPlugin(moduleFederationOptions);
|
|
325
|
-
generateMergedStatsAndManifestOptions.options.distOutputDir = ((_bundlerConfig_output2 = bundlerConfig.output) === null || _bundlerConfig_output2 === void 0 ? void 0 : _bundlerConfig_output2.path) || '';
|
|
326
|
-
bundlerConfig.plugins.push(generateMergedStatsAndManifestOptions.options.browserPlugin);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
var generateMergedStatsAndManifest = function() {
|
|
332
|
-
var _generateMergedStatsAndManifestOptions_options = generateMergedStatsAndManifestOptions.options, nodePlugin = _generateMergedStatsAndManifestOptions_options.nodePlugin, browserPlugin = _generateMergedStatsAndManifestOptions_options.browserPlugin, distOutputDir = _generateMergedStatsAndManifestOptions_options.distOutputDir;
|
|
333
|
-
if (!nodePlugin || !browserPlugin || !distOutputDir) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
utils.updateStatsAndManifest(nodePlugin, browserPlugin, distOutputDir);
|
|
337
|
-
};
|
|
338
|
-
api.onDevCompileDone(function() {
|
|
339
|
-
generateMergedStatsAndManifest();
|
|
340
|
-
});
|
|
341
|
-
api.onAfterBuild(function() {
|
|
342
|
-
generateMergedStatsAndManifest();
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
Object.defineProperty(exports, "PLUGIN_NAME", {
|
|
349
|
-
enumerable: true,
|
|
350
|
-
get: function () { return rspack.PLUGIN_NAME; }
|
|
351
|
-
});
|
|
352
|
-
Object.defineProperty(exports, "createModuleFederationConfig", {
|
|
353
|
-
enumerable: true,
|
|
354
|
-
get: function () { return sdk.createModuleFederationConfig; }
|
|
355
|
-
});
|
|
356
|
-
exports.SSR_DIR = utils.SSR_DIR;
|
|
357
|
-
exports.RSBUILD_PLUGIN_MODULE_FEDERATION_NAME = RSBUILD_PLUGIN_MODULE_FEDERATION_NAME;
|
|
358
|
-
exports.isMFFormat = isMFFormat;
|
|
359
|
-
exports.pluginModuleFederation = pluginModuleFederation;
|
|
360
|
-
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|