@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.cjs.js
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var util = require('util');
|
|
4
|
-
var constant = require('./constant.cjs.js');
|
|
5
|
-
var fs = require('fs-extra');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
var sdk = require('@module-federation/sdk');
|
|
8
|
-
var node_module = require('node:module');
|
|
9
|
-
|
|
10
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
11
|
-
var 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
|
-
var 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) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (!splitChunks || !(splitChunks === null || splitChunks === void 0 ? void 0 : splitChunks.cacheGroups)) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
var arrayShared = Array.isArray(mfConfig.shared) ? mfConfig.shared : Object.keys(mfConfig.shared);
|
|
41
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
42
|
-
try {
|
|
43
|
-
for(var _iterator = arrayShared[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
44
|
-
var shared = _step.value;
|
|
45
|
-
var splitChunkKey = SHARED_SPLIT_CHUNK_MAP[shared];
|
|
46
|
-
if (!splitChunkKey) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (splitChunks.cacheGroups[splitChunkKey]) {
|
|
50
|
-
delete splitChunks.cacheGroups[splitChunkKey];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
} catch (err) {
|
|
54
|
-
_didIteratorError = true;
|
|
55
|
-
_iteratorError = err;
|
|
56
|
-
} finally{
|
|
57
|
-
try {
|
|
58
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
59
|
-
_iterator.return();
|
|
60
|
-
}
|
|
61
|
-
} finally{
|
|
62
|
-
if (_didIteratorError) {
|
|
63
|
-
throw _iteratorError;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return splitChunks;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _type_of(obj) {
|
|
71
|
-
"@swc/helpers - typeof";
|
|
72
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
73
|
-
}
|
|
74
|
-
var addDataFetchExpose = function(exposes, key, filepath) {
|
|
75
|
-
var suffix = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : '';
|
|
76
|
-
if (!fs.existsSync(filepath)) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
var dataFetchKey = key === '.' ? "./".concat(constant.DATA_FETCH_IDENTIFIER).concat(suffix) : "".concat(key, ".").concat(constant.DATA_FETCH_IDENTIFIER).concat(suffix);
|
|
80
|
-
if (exposes[dataFetchKey] && exposes[dataFetchKey] !== filepath) {
|
|
81
|
-
throw new Error("data fetch key ".concat(dataFetchKey, " already exists, please modify this expose key, do not end with '").concat(constant.DATA_FETCH_IDENTIFIER, "' or '").concat(constant.DATA_FETCH_CLIENT_SUFFIX, "'"));
|
|
82
|
-
}
|
|
83
|
-
exposes[dataFetchKey] = filepath;
|
|
84
|
-
return dataFetchKey;
|
|
85
|
-
};
|
|
86
|
-
var addExcludeDtsSuffix = function(filepath) {
|
|
87
|
-
return "".concat(filepath, "?exclude-mf-dts=true");
|
|
88
|
-
};
|
|
89
|
-
function addDataFetchExposes(exposes, isServer) {
|
|
90
|
-
if ((typeof exposes === "undefined" ? "undefined" : _type_of(exposes)) !== 'object' || Array.isArray(exposes)) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (Object.keys(exposes).length === 0) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
var tempDataFetchFilepath = path.resolve(process.cwd(), "node_modules/".concat(sdk.TEMP_DIR, "/data-fetch-fallback.ts"));
|
|
97
|
-
var content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
98
|
-
fs.ensureDirSync(path.dirname(tempDataFetchFilepath));
|
|
99
|
-
fs.writeFileSync(tempDataFetchFilepath, content);
|
|
100
|
-
Object.keys(exposes).forEach(function(key) {
|
|
101
|
-
var expose = exposes[key];
|
|
102
|
-
if (typeof expose !== 'string') {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
var absPath = path.resolve(process.cwd(), expose);
|
|
106
|
-
var dataFetchPath = "".concat(absPath.replace(path.extname(absPath), ''), ".").concat(constant.DATA_FETCH_IDENTIFIER, ".ts");
|
|
107
|
-
var dataFetchClientPath = "".concat(absPath.replace(path.extname(absPath), ''), ".").concat(constant.DATA_FETCH_IDENTIFIER, ".client.ts");
|
|
108
|
-
var dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, constant.DATA_FETCH_CLIENT_SUFFIX);
|
|
109
|
-
if (!isServer && dateFetchClientKey) {
|
|
110
|
-
exposes[dateFetchClientKey.replace(constant.DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempDataFetchFilepath);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
var dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
114
|
-
if (dataFetchKey && fs.existsSync(dataFetchClientPath)) {
|
|
115
|
-
exposes["".concat(dataFetchKey).concat(constant.DATA_FETCH_CLIENT_SUFFIX)] = addExcludeDtsSuffix(tempDataFetchFilepath);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function mergeStats(browserStats, nodeStats) {
|
|
121
|
-
var ssrRemoteEntry = nodeStats.metaData.remoteEntry;
|
|
122
|
-
browserStats.metaData.ssrRemoteEntry = ssrRemoteEntry;
|
|
123
|
-
if ('publicPath' in browserStats.metaData) {
|
|
124
|
-
browserStats.metaData.ssrPublicPath = nodeStats.metaData.publicPath;
|
|
125
|
-
}
|
|
126
|
-
return browserStats;
|
|
127
|
-
}
|
|
128
|
-
function mergeManifest(browserManifest, nodeManifest) {
|
|
129
|
-
var ssrRemoteEntry = nodeManifest.metaData.remoteEntry;
|
|
130
|
-
browserManifest.metaData.ssrRemoteEntry = ssrRemoteEntry;
|
|
131
|
-
if ('publicPath' in browserManifest.metaData) {
|
|
132
|
-
browserManifest.metaData.ssrPublicPath = nodeManifest.metaData.publicPath;
|
|
133
|
-
}
|
|
134
|
-
return browserManifest;
|
|
135
|
-
}
|
|
136
|
-
function mergeStatsAndManifest(nodePlugin, browserPlugin) {
|
|
137
|
-
var nodeResourceInfo = nodePlugin.statsResourceInfo;
|
|
138
|
-
var browserResourceInfo = browserPlugin.statsResourceInfo;
|
|
139
|
-
if (!browserResourceInfo || !nodeResourceInfo || !browserResourceInfo.stats || !nodeResourceInfo.stats || !browserResourceInfo.manifest || !nodeResourceInfo.manifest) {
|
|
140
|
-
throw new Error('can not get browserResourceInfo or nodeResourceInfo');
|
|
141
|
-
}
|
|
142
|
-
var mergedStats = mergeStats(browserResourceInfo.stats.stats, nodeResourceInfo.stats.stats);
|
|
143
|
-
var mergedManifest = mergeManifest(browserResourceInfo.manifest.manifest, nodeResourceInfo.manifest.manifest);
|
|
144
|
-
return {
|
|
145
|
-
mergedStats: mergedStats,
|
|
146
|
-
mergedStatsFilePath: browserResourceInfo.stats.filename,
|
|
147
|
-
mergedManifest: mergedManifest,
|
|
148
|
-
mergedManifestFilePath: browserResourceInfo.manifest.filename
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function updateStatsAndManifest(nodePlugin, browserPlugin, outputDir) {
|
|
152
|
-
var _mergeStatsAndManifest = mergeStatsAndManifest(nodePlugin, browserPlugin), mergedStats = _mergeStatsAndManifest.mergedStats, mergedStatsFilePath = _mergeStatsAndManifest.mergedStatsFilePath, mergedManifest = _mergeStatsAndManifest.mergedManifest, mergedManifestFilePath = _mergeStatsAndManifest.mergedManifestFilePath;
|
|
153
|
-
fs.writeFileSync(path.resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
|
|
154
|
-
fs.writeFileSync(path.resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function _array_like_to_array(arr, len) {
|
|
158
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
159
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
160
|
-
return arr2;
|
|
161
|
-
}
|
|
162
|
-
function _array_without_holes(arr) {
|
|
163
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
164
|
-
}
|
|
165
|
-
function _define_property(obj, key, value) {
|
|
166
|
-
if (key in obj) {
|
|
167
|
-
Object.defineProperty(obj, key, {
|
|
168
|
-
value: value,
|
|
169
|
-
enumerable: true,
|
|
170
|
-
configurable: true,
|
|
171
|
-
writable: true
|
|
172
|
-
});
|
|
173
|
-
} else {
|
|
174
|
-
obj[key] = value;
|
|
175
|
-
}
|
|
176
|
-
return obj;
|
|
177
|
-
}
|
|
178
|
-
function _iterable_to_array(iter) {
|
|
179
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
180
|
-
}
|
|
181
|
-
function _non_iterable_spread() {
|
|
182
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
183
|
-
}
|
|
184
|
-
function _object_spread(target) {
|
|
185
|
-
for(var i = 1; i < arguments.length; i++){
|
|
186
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
187
|
-
var ownKeys = Object.keys(source);
|
|
188
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
189
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
190
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
191
|
-
}));
|
|
192
|
-
}
|
|
193
|
-
ownKeys.forEach(function(key) {
|
|
194
|
-
_define_property(target, key, source[key]);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
return target;
|
|
198
|
-
}
|
|
199
|
-
function ownKeys(object, enumerableOnly) {
|
|
200
|
-
var keys = Object.keys(object);
|
|
201
|
-
if (Object.getOwnPropertySymbols) {
|
|
202
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
203
|
-
keys.push.apply(keys, symbols);
|
|
204
|
-
}
|
|
205
|
-
return keys;
|
|
206
|
-
}
|
|
207
|
-
function _object_spread_props(target, source) {
|
|
208
|
-
source = source != null ? source : {};
|
|
209
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
210
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
211
|
-
} else {
|
|
212
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
213
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return target;
|
|
217
|
-
}
|
|
218
|
-
function _to_consumable_array(arr) {
|
|
219
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
220
|
-
}
|
|
221
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
222
|
-
if (!o) return;
|
|
223
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
224
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
225
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
226
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
227
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
228
|
-
}
|
|
229
|
-
var require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils.cjs.js', document.baseURI).href)));
|
|
230
|
-
var resolve = require$1.resolve;
|
|
231
|
-
var SSR_DIR = 'ssr';
|
|
232
|
-
var SSR_ENV_NAME = 'mf-ssr';
|
|
233
|
-
function setSSREnv() {
|
|
234
|
-
process.env['MF_DISABLE_EMIT_STATS'] = 'true';
|
|
235
|
-
process.env['MF_SSR_PRJ'] = 'true';
|
|
236
|
-
}
|
|
237
|
-
var isDev = function() {
|
|
238
|
-
return process.env['NODE_ENV'] === 'development';
|
|
239
|
-
};
|
|
240
|
-
function patchSSRRspackConfig(config, mfConfig, ssrDir, callerName) {
|
|
241
|
-
var resetEntry = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, modifyPublicPath = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
|
|
242
|
-
var _config_output;
|
|
243
|
-
var _config, _config1;
|
|
244
|
-
(_config = config).output || (_config.output = {});
|
|
245
|
-
if (modifyPublicPath) {
|
|
246
|
-
var _config_output1;
|
|
247
|
-
if (typeof ((_config_output1 = config.output) === null || _config_output1 === void 0 ? void 0 : _config_output1.publicPath) !== 'string') {
|
|
248
|
-
throw new Error('publicPath must be string!');
|
|
249
|
-
}
|
|
250
|
-
var publicPath = config.output.publicPath;
|
|
251
|
-
if (publicPath === 'auto') {
|
|
252
|
-
throw new Error('publicPath can not be "auto"!');
|
|
253
|
-
}
|
|
254
|
-
var publicPathWithSSRDir = "".concat(publicPath).concat(ssrDir, "/");
|
|
255
|
-
config.output.publicPath = publicPathWithSSRDir;
|
|
256
|
-
}
|
|
257
|
-
if (callerName === constant.CALL_NAME_MAP.RSPRESS && resetEntry) {
|
|
258
|
-
config.entry = 'data:application/node;base64,';
|
|
259
|
-
}
|
|
260
|
-
config.target = 'async-node';
|
|
261
|
-
var UniverseEntryChunkTrackerPlugin = require$1('@module-federation/node/universe-entry-chunk-tracker-plugin').default;
|
|
262
|
-
(_config1 = config).plugins || (_config1.plugins = []);
|
|
263
|
-
isDev() && config.plugins.push(new UniverseEntryChunkTrackerPlugin());
|
|
264
|
-
var uniqueName = mfConfig.name || ((_config_output = config.output) === null || _config_output === void 0 ? void 0 : _config_output.uniqueName);
|
|
265
|
-
var chunkFileName = config.output.chunkFilename;
|
|
266
|
-
if (typeof chunkFileName === 'string' && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
267
|
-
var suffix = "".concat(sdk.encodeName(uniqueName), "-[contenthash].js");
|
|
268
|
-
config.output.chunkFilename = chunkFileName.replace('.js', suffix);
|
|
269
|
-
}
|
|
270
|
-
return config;
|
|
271
|
-
}
|
|
272
|
-
function createSSRREnvConfig(envConfig, mfConfig, ssrDir, rsbuildConfig, callerName) {
|
|
273
|
-
var _ssrEnvConfig_output, _ssrEnvConfig_output_distPath, _ssrEnvConfig_output1, _rsbuildConfig_output_distPath, _rsbuildConfig_output;
|
|
274
|
-
var ssrEnvConfig = _object_spread_props(_object_spread({}, envConfig), {
|
|
275
|
-
tools: {
|
|
276
|
-
rspack: function(config, param) {
|
|
277
|
-
var environment = param.environment;
|
|
278
|
-
if (environment.name !== SSR_ENV_NAME) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
patchSSRRspackConfig(config, mfConfig, ssrDir, callerName);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
ssrEnvConfig.output = _object_spread_props(_object_spread({}, ssrEnvConfig.output), {
|
|
286
|
-
target: 'node',
|
|
287
|
-
distPath: _object_spread_props(_object_spread({}, (_ssrEnvConfig_output = ssrEnvConfig.output) === null || _ssrEnvConfig_output === void 0 ? void 0 : _ssrEnvConfig_output.distPath), {
|
|
288
|
-
root: path.join(((_ssrEnvConfig_output1 = ssrEnvConfig.output) === null || _ssrEnvConfig_output1 === void 0 ? void 0 : (_ssrEnvConfig_output_distPath = _ssrEnvConfig_output1.distPath) === null || _ssrEnvConfig_output_distPath === void 0 ? void 0 : _ssrEnvConfig_output_distPath.root) || ((_rsbuildConfig_output = rsbuildConfig.output) === null || _rsbuildConfig_output === void 0 ? void 0 : (_rsbuildConfig_output_distPath = _rsbuildConfig_output.distPath) === null || _rsbuildConfig_output_distPath === void 0 ? void 0 : _rsbuildConfig_output_distPath.root) || '', ssrDir)
|
|
289
|
-
}),
|
|
290
|
-
emitAssets: true
|
|
291
|
-
});
|
|
292
|
-
return ssrEnvConfig;
|
|
293
|
-
}
|
|
294
|
-
function createSSRMFConfig(mfConfig) {
|
|
295
|
-
var _mfConfig_library;
|
|
296
|
-
var _mfConfig_library_type;
|
|
297
|
-
var ssrMFConfig = _object_spread_props(_object_spread({}, mfConfig), {
|
|
298
|
-
exposes: _object_spread({}, mfConfig.exposes),
|
|
299
|
-
library: _object_spread_props(_object_spread({}, mfConfig.library), {
|
|
300
|
-
name: mfConfig.name,
|
|
301
|
-
type: (_mfConfig_library_type = (_mfConfig_library = mfConfig.library) === null || _mfConfig_library === void 0 ? void 0 : _mfConfig_library.type) !== null && _mfConfig_library_type !== void 0 ? _mfConfig_library_type : 'commonjs-module'
|
|
302
|
-
}),
|
|
303
|
-
dts: false,
|
|
304
|
-
dev: false,
|
|
305
|
-
runtimePlugins: _to_consumable_array(mfConfig.runtimePlugins || [])
|
|
306
|
-
});
|
|
307
|
-
ssrMFConfig.runtimePlugins.push(resolve('@module-federation/node/runtimePlugin'));
|
|
308
|
-
if (isDev()) {
|
|
309
|
-
ssrMFConfig.runtimePlugins.push(resolve('@module-federation/node/record-dynamic-remote-entry-hash-plugin'));
|
|
310
|
-
}
|
|
311
|
-
return ssrMFConfig;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
function isRegExp(target) {
|
|
315
|
-
return util.types.isRegExp(target);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
exports.DEFAULT_ASSET_PREFIX = constant.DEFAULT_ASSET_PREFIX;
|
|
319
|
-
exports.SSR_DIR = SSR_DIR;
|
|
320
|
-
exports.SSR_ENV_NAME = SSR_ENV_NAME;
|
|
321
|
-
exports.addDataFetchExposes = addDataFetchExposes;
|
|
322
|
-
exports.autoDeleteSplitChunkCacheGroups = autoDeleteSplitChunkCacheGroups;
|
|
323
|
-
exports.createSSRMFConfig = createSSRMFConfig;
|
|
324
|
-
exports.createSSRREnvConfig = createSSRREnvConfig;
|
|
325
|
-
exports.isRegExp = isRegExp;
|
|
326
|
-
exports.patchSSRRspackConfig = patchSSRRspackConfig;
|
|
327
|
-
exports.setSSREnv = setSSREnv;
|
|
328
|
-
exports.updateStatsAndManifest = updateStatsAndManifest;
|
|
329
|
-
//# sourceMappingURL=utils.cjs.js.map
|
package/dist/utils.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/utils/index";
|
package/dist/utils.esm.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/utils/index";
|
package/dist/utils.esm.mjs
DELETED
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import util from 'util';
|
|
2
|
-
import { DATA_FETCH_IDENTIFIER, DATA_FETCH_CLIENT_SUFFIX, CALL_NAME_MAP } from './constant.esm.mjs';
|
|
3
|
-
export { DEFAULT_ASSET_PREFIX } from './constant.esm.mjs';
|
|
4
|
-
import fs from 'fs-extra';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { TEMP_DIR, encodeName } from '@module-federation/sdk';
|
|
7
|
-
import { createRequire } from 'node:module';
|
|
8
|
-
|
|
9
|
-
var SPLIT_CHUNK_MAP = {
|
|
10
|
-
REACT: 'react',
|
|
11
|
-
ROUTER: 'router',
|
|
12
|
-
LODASH: 'lib-lodash',
|
|
13
|
-
ANTD: 'lib-antd',
|
|
14
|
-
ARCO: 'lib-arco',
|
|
15
|
-
SEMI: 'lib-semi',
|
|
16
|
-
AXIOS: 'lib-axios'
|
|
17
|
-
};
|
|
18
|
-
var SHARED_SPLIT_CHUNK_MAP = {
|
|
19
|
-
react: SPLIT_CHUNK_MAP.REACT,
|
|
20
|
-
'react-dom': SPLIT_CHUNK_MAP.REACT,
|
|
21
|
-
'react-router': SPLIT_CHUNK_MAP.ROUTER,
|
|
22
|
-
'react-router-dom': SPLIT_CHUNK_MAP.ROUTER,
|
|
23
|
-
'@remix-run/router': SPLIT_CHUNK_MAP.ROUTER,
|
|
24
|
-
lodash: SPLIT_CHUNK_MAP.LODASH,
|
|
25
|
-
'lodash-es': SPLIT_CHUNK_MAP.LODASH,
|
|
26
|
-
antd: SPLIT_CHUNK_MAP.ANTD,
|
|
27
|
-
'@arco-design/web-react': SPLIT_CHUNK_MAP.ARCO,
|
|
28
|
-
'@douyinfe/semi-ui': SPLIT_CHUNK_MAP.SEMI,
|
|
29
|
-
axios: SPLIT_CHUNK_MAP.AXIOS
|
|
30
|
-
};
|
|
31
|
-
function autoDeleteSplitChunkCacheGroups(mfConfig, splitChunks) {
|
|
32
|
-
if (!mfConfig.shared) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (!splitChunks || !(splitChunks === null || splitChunks === void 0 ? void 0 : splitChunks.cacheGroups)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
var arrayShared = Array.isArray(mfConfig.shared) ? mfConfig.shared : Object.keys(mfConfig.shared);
|
|
39
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
40
|
-
try {
|
|
41
|
-
for(var _iterator = arrayShared[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
42
|
-
var shared = _step.value;
|
|
43
|
-
var splitChunkKey = SHARED_SPLIT_CHUNK_MAP[shared];
|
|
44
|
-
if (!splitChunkKey) {
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
if (splitChunks.cacheGroups[splitChunkKey]) {
|
|
48
|
-
delete splitChunks.cacheGroups[splitChunkKey];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
} catch (err) {
|
|
52
|
-
_didIteratorError = true;
|
|
53
|
-
_iteratorError = err;
|
|
54
|
-
} finally{
|
|
55
|
-
try {
|
|
56
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
57
|
-
_iterator.return();
|
|
58
|
-
}
|
|
59
|
-
} finally{
|
|
60
|
-
if (_didIteratorError) {
|
|
61
|
-
throw _iteratorError;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return splitChunks;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _type_of(obj) {
|
|
69
|
-
"@swc/helpers - typeof";
|
|
70
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
71
|
-
}
|
|
72
|
-
var addDataFetchExpose = function(exposes, key, filepath) {
|
|
73
|
-
var suffix = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : '';
|
|
74
|
-
if (!fs.existsSync(filepath)) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
var dataFetchKey = key === '.' ? "./".concat(DATA_FETCH_IDENTIFIER).concat(suffix) : "".concat(key, ".").concat(DATA_FETCH_IDENTIFIER).concat(suffix);
|
|
78
|
-
if (exposes[dataFetchKey] && exposes[dataFetchKey] !== filepath) {
|
|
79
|
-
throw new Error("data fetch key ".concat(dataFetchKey, " already exists, please modify this expose key, do not end with '").concat(DATA_FETCH_IDENTIFIER, "' or '").concat(DATA_FETCH_CLIENT_SUFFIX, "'"));
|
|
80
|
-
}
|
|
81
|
-
exposes[dataFetchKey] = filepath;
|
|
82
|
-
return dataFetchKey;
|
|
83
|
-
};
|
|
84
|
-
var addExcludeDtsSuffix = function(filepath) {
|
|
85
|
-
return "".concat(filepath, "?exclude-mf-dts=true");
|
|
86
|
-
};
|
|
87
|
-
function addDataFetchExposes(exposes, isServer) {
|
|
88
|
-
if ((typeof exposes === "undefined" ? "undefined" : _type_of(exposes)) !== 'object' || Array.isArray(exposes)) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (Object.keys(exposes).length === 0) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
var tempDataFetchFilepath = path.resolve(process.cwd(), "node_modules/".concat(TEMP_DIR, "/data-fetch-fallback.ts"));
|
|
95
|
-
var content = "export const fetchData=()=>{throw new Error('should not be called')};";
|
|
96
|
-
fs.ensureDirSync(path.dirname(tempDataFetchFilepath));
|
|
97
|
-
fs.writeFileSync(tempDataFetchFilepath, content);
|
|
98
|
-
Object.keys(exposes).forEach(function(key) {
|
|
99
|
-
var expose = exposes[key];
|
|
100
|
-
if (typeof expose !== 'string') {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
var absPath = path.resolve(process.cwd(), expose);
|
|
104
|
-
var dataFetchPath = "".concat(absPath.replace(path.extname(absPath), ''), ".").concat(DATA_FETCH_IDENTIFIER, ".ts");
|
|
105
|
-
var dataFetchClientPath = "".concat(absPath.replace(path.extname(absPath), ''), ".").concat(DATA_FETCH_IDENTIFIER, ".client.ts");
|
|
106
|
-
var dateFetchClientKey = addDataFetchExpose(exposes, key, dataFetchClientPath, DATA_FETCH_CLIENT_SUFFIX);
|
|
107
|
-
if (!isServer && dateFetchClientKey) {
|
|
108
|
-
exposes[dateFetchClientKey.replace(DATA_FETCH_CLIENT_SUFFIX, '')] = addExcludeDtsSuffix(tempDataFetchFilepath);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
var dataFetchKey = addDataFetchExpose(exposes, key, dataFetchPath);
|
|
112
|
-
if (dataFetchKey && fs.existsSync(dataFetchClientPath)) {
|
|
113
|
-
exposes["".concat(dataFetchKey).concat(DATA_FETCH_CLIENT_SUFFIX)] = addExcludeDtsSuffix(tempDataFetchFilepath);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function mergeStats(browserStats, nodeStats) {
|
|
119
|
-
var ssrRemoteEntry = nodeStats.metaData.remoteEntry;
|
|
120
|
-
browserStats.metaData.ssrRemoteEntry = ssrRemoteEntry;
|
|
121
|
-
if ('publicPath' in browserStats.metaData) {
|
|
122
|
-
browserStats.metaData.ssrPublicPath = nodeStats.metaData.publicPath;
|
|
123
|
-
}
|
|
124
|
-
return browserStats;
|
|
125
|
-
}
|
|
126
|
-
function mergeManifest(browserManifest, nodeManifest) {
|
|
127
|
-
var ssrRemoteEntry = nodeManifest.metaData.remoteEntry;
|
|
128
|
-
browserManifest.metaData.ssrRemoteEntry = ssrRemoteEntry;
|
|
129
|
-
if ('publicPath' in browserManifest.metaData) {
|
|
130
|
-
browserManifest.metaData.ssrPublicPath = nodeManifest.metaData.publicPath;
|
|
131
|
-
}
|
|
132
|
-
return browserManifest;
|
|
133
|
-
}
|
|
134
|
-
function mergeStatsAndManifest(nodePlugin, browserPlugin) {
|
|
135
|
-
var nodeResourceInfo = nodePlugin.statsResourceInfo;
|
|
136
|
-
var browserResourceInfo = browserPlugin.statsResourceInfo;
|
|
137
|
-
if (!browserResourceInfo || !nodeResourceInfo || !browserResourceInfo.stats || !nodeResourceInfo.stats || !browserResourceInfo.manifest || !nodeResourceInfo.manifest) {
|
|
138
|
-
throw new Error('can not get browserResourceInfo or nodeResourceInfo');
|
|
139
|
-
}
|
|
140
|
-
var mergedStats = mergeStats(browserResourceInfo.stats.stats, nodeResourceInfo.stats.stats);
|
|
141
|
-
var mergedManifest = mergeManifest(browserResourceInfo.manifest.manifest, nodeResourceInfo.manifest.manifest);
|
|
142
|
-
return {
|
|
143
|
-
mergedStats: mergedStats,
|
|
144
|
-
mergedStatsFilePath: browserResourceInfo.stats.filename,
|
|
145
|
-
mergedManifest: mergedManifest,
|
|
146
|
-
mergedManifestFilePath: browserResourceInfo.manifest.filename
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function updateStatsAndManifest(nodePlugin, browserPlugin, outputDir) {
|
|
150
|
-
var _mergeStatsAndManifest = mergeStatsAndManifest(nodePlugin, browserPlugin), mergedStats = _mergeStatsAndManifest.mergedStats, mergedStatsFilePath = _mergeStatsAndManifest.mergedStatsFilePath, mergedManifest = _mergeStatsAndManifest.mergedManifest, mergedManifestFilePath = _mergeStatsAndManifest.mergedManifestFilePath;
|
|
151
|
-
fs.writeFileSync(path.resolve(outputDir, mergedStatsFilePath), JSON.stringify(mergedStats, null, 2));
|
|
152
|
-
fs.writeFileSync(path.resolve(outputDir, mergedManifestFilePath), JSON.stringify(mergedManifest, null, 2));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function _array_like_to_array(arr, len) {
|
|
156
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
157
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
158
|
-
return arr2;
|
|
159
|
-
}
|
|
160
|
-
function _array_without_holes(arr) {
|
|
161
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
162
|
-
}
|
|
163
|
-
function _define_property(obj, key, value) {
|
|
164
|
-
if (key in obj) {
|
|
165
|
-
Object.defineProperty(obj, key, {
|
|
166
|
-
value: value,
|
|
167
|
-
enumerable: true,
|
|
168
|
-
configurable: true,
|
|
169
|
-
writable: true
|
|
170
|
-
});
|
|
171
|
-
} else {
|
|
172
|
-
obj[key] = value;
|
|
173
|
-
}
|
|
174
|
-
return obj;
|
|
175
|
-
}
|
|
176
|
-
function _iterable_to_array(iter) {
|
|
177
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
178
|
-
}
|
|
179
|
-
function _non_iterable_spread() {
|
|
180
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
181
|
-
}
|
|
182
|
-
function _object_spread(target) {
|
|
183
|
-
for(var i = 1; i < arguments.length; i++){
|
|
184
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
185
|
-
var ownKeys = Object.keys(source);
|
|
186
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
187
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
188
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
189
|
-
}));
|
|
190
|
-
}
|
|
191
|
-
ownKeys.forEach(function(key) {
|
|
192
|
-
_define_property(target, key, source[key]);
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
return target;
|
|
196
|
-
}
|
|
197
|
-
function ownKeys(object, enumerableOnly) {
|
|
198
|
-
var keys = Object.keys(object);
|
|
199
|
-
if (Object.getOwnPropertySymbols) {
|
|
200
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
201
|
-
keys.push.apply(keys, symbols);
|
|
202
|
-
}
|
|
203
|
-
return keys;
|
|
204
|
-
}
|
|
205
|
-
function _object_spread_props(target, source) {
|
|
206
|
-
source = source != null ? source : {};
|
|
207
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
208
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
209
|
-
} else {
|
|
210
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
211
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
return target;
|
|
215
|
-
}
|
|
216
|
-
function _to_consumable_array(arr) {
|
|
217
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
218
|
-
}
|
|
219
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
220
|
-
if (!o) return;
|
|
221
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
222
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
223
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
224
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
225
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
226
|
-
}
|
|
227
|
-
var require = createRequire(import.meta.url);
|
|
228
|
-
var resolve = require.resolve;
|
|
229
|
-
var SSR_DIR = 'ssr';
|
|
230
|
-
var SSR_ENV_NAME = 'mf-ssr';
|
|
231
|
-
function setSSREnv() {
|
|
232
|
-
process.env['MF_DISABLE_EMIT_STATS'] = 'true';
|
|
233
|
-
process.env['MF_SSR_PRJ'] = 'true';
|
|
234
|
-
}
|
|
235
|
-
var isDev = function() {
|
|
236
|
-
return process.env['NODE_ENV'] === 'development';
|
|
237
|
-
};
|
|
238
|
-
function patchSSRRspackConfig(config, mfConfig, ssrDir, callerName) {
|
|
239
|
-
var resetEntry = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, modifyPublicPath = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
|
|
240
|
-
var _config_output;
|
|
241
|
-
var _config, _config1;
|
|
242
|
-
(_config = config).output || (_config.output = {});
|
|
243
|
-
if (modifyPublicPath) {
|
|
244
|
-
var _config_output1;
|
|
245
|
-
if (typeof ((_config_output1 = config.output) === null || _config_output1 === void 0 ? void 0 : _config_output1.publicPath) !== 'string') {
|
|
246
|
-
throw new Error('publicPath must be string!');
|
|
247
|
-
}
|
|
248
|
-
var publicPath = config.output.publicPath;
|
|
249
|
-
if (publicPath === 'auto') {
|
|
250
|
-
throw new Error('publicPath can not be "auto"!');
|
|
251
|
-
}
|
|
252
|
-
var publicPathWithSSRDir = "".concat(publicPath).concat(ssrDir, "/");
|
|
253
|
-
config.output.publicPath = publicPathWithSSRDir;
|
|
254
|
-
}
|
|
255
|
-
if (callerName === CALL_NAME_MAP.RSPRESS && resetEntry) {
|
|
256
|
-
config.entry = 'data:application/node;base64,';
|
|
257
|
-
}
|
|
258
|
-
config.target = 'async-node';
|
|
259
|
-
var UniverseEntryChunkTrackerPlugin = require('@module-federation/node/universe-entry-chunk-tracker-plugin').default;
|
|
260
|
-
(_config1 = config).plugins || (_config1.plugins = []);
|
|
261
|
-
isDev() && config.plugins.push(new UniverseEntryChunkTrackerPlugin());
|
|
262
|
-
var uniqueName = mfConfig.name || ((_config_output = config.output) === null || _config_output === void 0 ? void 0 : _config_output.uniqueName);
|
|
263
|
-
var chunkFileName = config.output.chunkFilename;
|
|
264
|
-
if (typeof chunkFileName === 'string' && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
265
|
-
var suffix = "".concat(encodeName(uniqueName), "-[contenthash].js");
|
|
266
|
-
config.output.chunkFilename = chunkFileName.replace('.js', suffix);
|
|
267
|
-
}
|
|
268
|
-
return config;
|
|
269
|
-
}
|
|
270
|
-
function createSSRREnvConfig(envConfig, mfConfig, ssrDir, rsbuildConfig, callerName) {
|
|
271
|
-
var _ssrEnvConfig_output, _ssrEnvConfig_output_distPath, _ssrEnvConfig_output1, _rsbuildConfig_output_distPath, _rsbuildConfig_output;
|
|
272
|
-
var ssrEnvConfig = _object_spread_props(_object_spread({}, envConfig), {
|
|
273
|
-
tools: {
|
|
274
|
-
rspack: function(config, param) {
|
|
275
|
-
var environment = param.environment;
|
|
276
|
-
if (environment.name !== SSR_ENV_NAME) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
patchSSRRspackConfig(config, mfConfig, ssrDir, callerName);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
ssrEnvConfig.output = _object_spread_props(_object_spread({}, ssrEnvConfig.output), {
|
|
284
|
-
target: 'node',
|
|
285
|
-
distPath: _object_spread_props(_object_spread({}, (_ssrEnvConfig_output = ssrEnvConfig.output) === null || _ssrEnvConfig_output === void 0 ? void 0 : _ssrEnvConfig_output.distPath), {
|
|
286
|
-
root: path.join(((_ssrEnvConfig_output1 = ssrEnvConfig.output) === null || _ssrEnvConfig_output1 === void 0 ? void 0 : (_ssrEnvConfig_output_distPath = _ssrEnvConfig_output1.distPath) === null || _ssrEnvConfig_output_distPath === void 0 ? void 0 : _ssrEnvConfig_output_distPath.root) || ((_rsbuildConfig_output = rsbuildConfig.output) === null || _rsbuildConfig_output === void 0 ? void 0 : (_rsbuildConfig_output_distPath = _rsbuildConfig_output.distPath) === null || _rsbuildConfig_output_distPath === void 0 ? void 0 : _rsbuildConfig_output_distPath.root) || '', ssrDir)
|
|
287
|
-
}),
|
|
288
|
-
emitAssets: true
|
|
289
|
-
});
|
|
290
|
-
return ssrEnvConfig;
|
|
291
|
-
}
|
|
292
|
-
function createSSRMFConfig(mfConfig) {
|
|
293
|
-
var _mfConfig_library;
|
|
294
|
-
var _mfConfig_library_type;
|
|
295
|
-
var ssrMFConfig = _object_spread_props(_object_spread({}, mfConfig), {
|
|
296
|
-
exposes: _object_spread({}, mfConfig.exposes),
|
|
297
|
-
library: _object_spread_props(_object_spread({}, mfConfig.library), {
|
|
298
|
-
name: mfConfig.name,
|
|
299
|
-
type: (_mfConfig_library_type = (_mfConfig_library = mfConfig.library) === null || _mfConfig_library === void 0 ? void 0 : _mfConfig_library.type) !== null && _mfConfig_library_type !== void 0 ? _mfConfig_library_type : 'commonjs-module'
|
|
300
|
-
}),
|
|
301
|
-
dts: false,
|
|
302
|
-
dev: false,
|
|
303
|
-
runtimePlugins: _to_consumable_array(mfConfig.runtimePlugins || [])
|
|
304
|
-
});
|
|
305
|
-
ssrMFConfig.runtimePlugins.push(resolve('@module-federation/node/runtimePlugin'));
|
|
306
|
-
if (isDev()) {
|
|
307
|
-
ssrMFConfig.runtimePlugins.push(resolve('@module-federation/node/record-dynamic-remote-entry-hash-plugin'));
|
|
308
|
-
}
|
|
309
|
-
return ssrMFConfig;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
function isRegExp(target) {
|
|
313
|
-
return util.types.isRegExp(target);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export { SSR_DIR, SSR_ENV_NAME, addDataFetchExposes, autoDeleteSplitChunkCacheGroups, createSSRMFConfig, createSSRREnvConfig, isRegExp, patchSSRRspackConfig, setSSREnv, updateStatsAndManifest };
|
|
317
|
-
//# sourceMappingURL=utils.esm.mjs.map
|
package/dist/utils.esm.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|