@module-federation/metro 0.0.0-chore-bump-node-22-20260710161714
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/LICENSE +21 -0
- package/README.md +11 -0
- package/babel-plugin/index.js +115 -0
- package/babel-plugin/patch-initialize-core.js +61 -0
- package/babel-plugin/patch-require.js +174 -0
- package/bootstrap/index.d.ts +1 -0
- package/bootstrap/index.js +1 -0
- package/dist/babel/transformer.js +15 -0
- package/dist/commands/bundle-host/index.d.ts +13 -0
- package/dist/commands/bundle-host/index.js +100 -0
- package/dist/commands/bundle-host/index.mjs +47 -0
- package/dist/commands/bundle-host/options.d.ts +5 -0
- package/dist/commands/bundle-host/options.js +43 -0
- package/dist/commands/bundle-host/options.mjs +6 -0
- package/dist/commands/bundle-host/types.d.ts +22 -0
- package/dist/commands/bundle-host/types.js +18 -0
- package/dist/commands/bundle-host/types.mjs +1 -0
- package/dist/commands/bundle-remote/index.d.ts +12 -0
- package/dist/commands/bundle-remote/index.js +241 -0
- package/dist/commands/bundle-remote/index.mjs +190 -0
- package/dist/commands/bundle-remote/options.d.ts +32 -0
- package/dist/commands/bundle-remote/options.js +113 -0
- package/dist/commands/bundle-remote/options.mjs +66 -0
- package/dist/commands/bundle-remote/types.d.ts +16 -0
- package/dist/commands/bundle-remote/types.js +18 -0
- package/dist/commands/bundle-remote/types.mjs +1 -0
- package/dist/commands/index.d.ts +48 -0
- package/dist/commands/index.js +76 -0
- package/dist/commands/index.mjs +13 -0
- package/dist/commands/types.d.ts +14 -0
- package/dist/commands/types.js +18 -0
- package/dist/commands/types.mjs +1 -0
- package/dist/commands/utils/create-module-path-remapper.d.ts +7 -0
- package/dist/commands/utils/create-module-path-remapper.js +68 -0
- package/dist/commands/utils/create-module-path-remapper.mjs +31 -0
- package/dist/commands/utils/create-resolver.d.ts +20 -0
- package/dist/commands/utils/create-resolver.js +61 -0
- package/dist/commands/utils/create-resolver.mjs +24 -0
- package/dist/commands/utils/get-community-plugin.d.ts +28 -0
- package/dist/commands/utils/get-community-plugin.js +53 -0
- package/dist/commands/utils/get-community-plugin.mjs +17 -0
- package/dist/commands/utils/load-metro-config.d.ts +3 -0
- package/dist/commands/utils/load-metro-config.js +85 -0
- package/dist/commands/utils/load-metro-config.mjs +41 -0
- package/dist/commands/utils/path-utils.d.ts +2 -0
- package/dist/commands/utils/path-utils.js +51 -0
- package/dist/commands/utils/path-utils.mjs +11 -0
- package/dist/commands/utils/save-bundle-and-map.d.ts +5 -0
- package/dist/commands/utils/save-bundle-and-map.js +80 -0
- package/dist/commands/utils/save-bundle-and-map.mjs +33 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +44 -0
- package/dist/index.mjs +3 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.js +43 -0
- package/dist/logger.mjs +6 -0
- package/dist/modules/HMRClient.ts +31 -0
- package/dist/modules/HMRClientShim.ts +1 -0
- package/dist/modules/asyncRequire.ts +156 -0
- package/dist/modules/asyncStartup.tsx +43 -0
- package/dist/modules/getDevServer.ts +15 -0
- package/dist/modules/metroCorePlugin.ts +87 -0
- package/dist/plugin/babel-transformer.d.ts +11 -0
- package/dist/plugin/babel-transformer.js +72 -0
- package/dist/plugin/babel-transformer.mjs +25 -0
- package/dist/plugin/constants.d.ts +10 -0
- package/dist/plugin/constants.js +76 -0
- package/dist/plugin/constants.mjs +12 -0
- package/dist/plugin/generators.d.ts +13 -0
- package/dist/plugin/generators.js +164 -0
- package/dist/plugin/generators.mjs +102 -0
- package/dist/plugin/helpers.d.ts +8 -0
- package/dist/plugin/helpers.js +127 -0
- package/dist/plugin/helpers.mjs +58 -0
- package/dist/plugin/index.d.ts +11 -0
- package/dist/plugin/index.js +219 -0
- package/dist/plugin/index.mjs +172 -0
- package/dist/plugin/manifest-middleware.d.ts +12 -0
- package/dist/plugin/manifest-middleware.js +217 -0
- package/dist/plugin/manifest-middleware.mjs +170 -0
- package/dist/plugin/manifest.d.ts +16 -0
- package/dist/plugin/manifest.js +246 -0
- package/dist/plugin/manifest.mjs +185 -0
- package/dist/plugin/normalize-extra-options.d.ts +8 -0
- package/dist/plugin/normalize-extra-options.js +50 -0
- package/dist/plugin/normalize-extra-options.mjs +13 -0
- package/dist/plugin/normalize-options.d.ts +7 -0
- package/dist/plugin/normalize-options.js +139 -0
- package/dist/plugin/normalize-options.mjs +92 -0
- package/dist/plugin/resolver.d.ts +26 -0
- package/dist/plugin/resolver.js +203 -0
- package/dist/plugin/resolver.mjs +159 -0
- package/dist/plugin/rewrite-request.d.ts +14 -0
- package/dist/plugin/rewrite-request.js +89 -0
- package/dist/plugin/rewrite-request.mjs +42 -0
- package/dist/plugin/serializer.d.ts +6 -0
- package/dist/plugin/serializer.js +191 -0
- package/dist/plugin/serializer.mjs +144 -0
- package/dist/plugin/validate-options.d.ts +2 -0
- package/dist/plugin/validate-options.js +165 -0
- package/dist/plugin/validate-options.mjs +117 -0
- package/dist/runtime/host-entry.js +3 -0
- package/dist/runtime/init-host.js +31 -0
- package/dist/runtime/remote-entry.js +57 -0
- package/dist/runtime/remote-hmr.js +19 -0
- package/dist/runtime/remote-module-registry.js +57 -0
- package/dist/runtime/remote-module.js +2 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.js +18 -0
- package/dist/types.mjs +1 -0
- package/dist/utils/errors.d.ts +8 -0
- package/dist/utils/errors.js +54 -0
- package/dist/utils/errors.mjs +14 -0
- package/dist/utils/federated-remote-types.d.ts +12 -0
- package/dist/utils/federated-remote-types.js +140 -0
- package/dist/utils/federated-remote-types.mjs +90 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +47 -0
- package/dist/utils/index.mjs +3 -0
- package/dist/utils/metro-compat.d.ts +23 -0
- package/dist/utils/metro-compat.js +74 -0
- package/dist/utils/metro-compat.mjs +26 -0
- package/dist/utils/vm-manager.d.ts +21 -0
- package/dist/utils/vm-manager.js +118 -0
- package/dist/utils/vm-manager.mjs +70 -0
- package/package.json +106 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
createBabelTransformer: ()=>createBabelTransformer
|
|
41
|
+
});
|
|
42
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
43
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
44
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
45
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
46
|
+
function createBabelTransformer({ blacklistedPaths, federationConfig, originalBabelTransformerPath, tmpDirPath, enableInitializeCorePatching, enableRuntimeRequirePatching }) {
|
|
47
|
+
const outputPath = external_node_path_default().join(tmpDirPath, 'babel-transformer.js');
|
|
48
|
+
const templatePath = require.resolve('../babel/transformer.js');
|
|
49
|
+
const transformerTemplate = external_node_fs_default().readFileSync(templatePath, 'utf-8');
|
|
50
|
+
const plugins = [
|
|
51
|
+
[
|
|
52
|
+
'@module-federation/metro/babel-plugin',
|
|
53
|
+
{
|
|
54
|
+
blacklistedPaths,
|
|
55
|
+
remotes: federationConfig.remotes,
|
|
56
|
+
shared: federationConfig.shared
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
enableInitializeCorePatching ? '@module-federation/metro/babel-plugin/patch-initialize-core' : void 0,
|
|
60
|
+
enableRuntimeRequirePatching ? '@module-federation/metro/babel-plugin/patch-require' : void 0
|
|
61
|
+
].filter(Boolean);
|
|
62
|
+
const babelTransformer = transformerTemplate.replaceAll('__BABEL_TRANSFORMER_PATH__', JSON.stringify(originalBabelTransformerPath)).replaceAll('__BABEL_PLUGINS__', JSON.stringify(plugins));
|
|
63
|
+
external_node_fs_default().writeFileSync(outputPath, babelTransformer, 'utf-8');
|
|
64
|
+
return outputPath;
|
|
65
|
+
}
|
|
66
|
+
exports.createBabelTransformer = __webpack_exports__.createBabelTransformer;
|
|
67
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
68
|
+
"createBabelTransformer"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import __rslib_shim_module__ from "node:module";
|
|
2
|
+
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
|
+
import node_fs from "node:fs";
|
|
4
|
+
import node_path from "node:path";
|
|
5
|
+
function createBabelTransformer({ blacklistedPaths, federationConfig, originalBabelTransformerPath, tmpDirPath, enableInitializeCorePatching, enableRuntimeRequirePatching }) {
|
|
6
|
+
const outputPath = node_path.join(tmpDirPath, 'babel-transformer.js');
|
|
7
|
+
const templatePath = require.resolve('../babel/transformer.js');
|
|
8
|
+
const transformerTemplate = node_fs.readFileSync(templatePath, 'utf-8');
|
|
9
|
+
const plugins = [
|
|
10
|
+
[
|
|
11
|
+
'@module-federation/metro/babel-plugin',
|
|
12
|
+
{
|
|
13
|
+
blacklistedPaths,
|
|
14
|
+
remotes: federationConfig.remotes,
|
|
15
|
+
shared: federationConfig.shared
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
enableInitializeCorePatching ? '@module-federation/metro/babel-plugin/patch-initialize-core' : void 0,
|
|
19
|
+
enableRuntimeRequirePatching ? '@module-federation/metro/babel-plugin/patch-require' : void 0
|
|
20
|
+
].filter(Boolean);
|
|
21
|
+
const babelTransformer = transformerTemplate.replaceAll('__BABEL_TRANSFORMER_PATH__', JSON.stringify(originalBabelTransformerPath)).replaceAll('__BABEL_PLUGINS__', JSON.stringify(plugins));
|
|
22
|
+
node_fs.writeFileSync(outputPath, babelTransformer, 'utf-8');
|
|
23
|
+
return outputPath;
|
|
24
|
+
}
|
|
25
|
+
export { createBabelTransformer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const INIT_HOST = "mf:init-host";
|
|
2
|
+
export declare const ASYNC_REQUIRE = "mf:async-require";
|
|
3
|
+
export declare const REMOTE_MODULE_REGISTRY = "mf:remote-module-registry";
|
|
4
|
+
export declare const REMOTE_HMR_SETUP = "mf:remote-hmr";
|
|
5
|
+
export declare const PLUGIN_IDENTIFIER = "[ Module Federation Metro ]";
|
|
6
|
+
export declare const DEFAULT_ENTRY_FILENAME = "remoteEntry.bundle";
|
|
7
|
+
export declare const GET_DEV_SERVER_REGEX: RegExp;
|
|
8
|
+
export declare const HMR_CLIENT_REGEX: RegExp;
|
|
9
|
+
export declare const TMP_DIR_NAME = ".mf-metro";
|
|
10
|
+
export declare const MANIFEST_FILENAME = "mf-manifest.json";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
const INIT_HOST = 'mf:init-host';
|
|
31
|
+
const ASYNC_REQUIRE = 'mf:async-require';
|
|
32
|
+
const REMOTE_MODULE_REGISTRY = 'mf:remote-module-registry';
|
|
33
|
+
const REMOTE_HMR_SETUP = 'mf:remote-hmr';
|
|
34
|
+
const PLUGIN_IDENTIFIER = '[ Module Federation Metro ]';
|
|
35
|
+
const DEFAULT_ENTRY_FILENAME = 'remoteEntry.bundle';
|
|
36
|
+
const GET_DEV_SERVER_REGEX = /react-native\/Libraries\/Core\/Devtools\/getDevServer\.js$/;
|
|
37
|
+
const HMR_CLIENT_REGEX = /react-native\/Libraries\/Utilities\/HMRClient\.js$/;
|
|
38
|
+
const TMP_DIR_NAME = '.mf-metro';
|
|
39
|
+
const MANIFEST_FILENAME = 'mf-manifest.json';
|
|
40
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
41
|
+
ASYNC_REQUIRE: ASYNC_REQUIRE,
|
|
42
|
+
DEFAULT_ENTRY_FILENAME: DEFAULT_ENTRY_FILENAME,
|
|
43
|
+
GET_DEV_SERVER_REGEX: GET_DEV_SERVER_REGEX,
|
|
44
|
+
HMR_CLIENT_REGEX: HMR_CLIENT_REGEX,
|
|
45
|
+
INIT_HOST: INIT_HOST,
|
|
46
|
+
MANIFEST_FILENAME: MANIFEST_FILENAME,
|
|
47
|
+
PLUGIN_IDENTIFIER: PLUGIN_IDENTIFIER,
|
|
48
|
+
REMOTE_HMR_SETUP: REMOTE_HMR_SETUP,
|
|
49
|
+
REMOTE_MODULE_REGISTRY: REMOTE_MODULE_REGISTRY,
|
|
50
|
+
TMP_DIR_NAME: TMP_DIR_NAME
|
|
51
|
+
});
|
|
52
|
+
exports.ASYNC_REQUIRE = __webpack_exports__.ASYNC_REQUIRE;
|
|
53
|
+
exports.DEFAULT_ENTRY_FILENAME = __webpack_exports__.DEFAULT_ENTRY_FILENAME;
|
|
54
|
+
exports.GET_DEV_SERVER_REGEX = __webpack_exports__.GET_DEV_SERVER_REGEX;
|
|
55
|
+
exports.HMR_CLIENT_REGEX = __webpack_exports__.HMR_CLIENT_REGEX;
|
|
56
|
+
exports.INIT_HOST = __webpack_exports__.INIT_HOST;
|
|
57
|
+
exports.MANIFEST_FILENAME = __webpack_exports__.MANIFEST_FILENAME;
|
|
58
|
+
exports.PLUGIN_IDENTIFIER = __webpack_exports__.PLUGIN_IDENTIFIER;
|
|
59
|
+
exports.REMOTE_HMR_SETUP = __webpack_exports__.REMOTE_HMR_SETUP;
|
|
60
|
+
exports.REMOTE_MODULE_REGISTRY = __webpack_exports__.REMOTE_MODULE_REGISTRY;
|
|
61
|
+
exports.TMP_DIR_NAME = __webpack_exports__.TMP_DIR_NAME;
|
|
62
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
63
|
+
"ASYNC_REQUIRE",
|
|
64
|
+
"DEFAULT_ENTRY_FILENAME",
|
|
65
|
+
"GET_DEV_SERVER_REGEX",
|
|
66
|
+
"HMR_CLIENT_REGEX",
|
|
67
|
+
"INIT_HOST",
|
|
68
|
+
"MANIFEST_FILENAME",
|
|
69
|
+
"PLUGIN_IDENTIFIER",
|
|
70
|
+
"REMOTE_HMR_SETUP",
|
|
71
|
+
"REMOTE_MODULE_REGISTRY",
|
|
72
|
+
"TMP_DIR_NAME"
|
|
73
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
74
|
+
Object.defineProperty(exports, '__esModule', {
|
|
75
|
+
value: true
|
|
76
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
const INIT_HOST = 'mf:init-host';
|
|
3
|
+
const ASYNC_REQUIRE = 'mf:async-require';
|
|
4
|
+
const REMOTE_MODULE_REGISTRY = 'mf:remote-module-registry';
|
|
5
|
+
const REMOTE_HMR_SETUP = 'mf:remote-hmr';
|
|
6
|
+
const PLUGIN_IDENTIFIER = '[ Module Federation Metro ]';
|
|
7
|
+
const DEFAULT_ENTRY_FILENAME = 'remoteEntry.bundle';
|
|
8
|
+
const GET_DEV_SERVER_REGEX = /react-native\/Libraries\/Core\/Devtools\/getDevServer\.js$/;
|
|
9
|
+
const HMR_CLIENT_REGEX = /react-native\/Libraries\/Utilities\/HMRClient\.js$/;
|
|
10
|
+
const TMP_DIR_NAME = '.mf-metro';
|
|
11
|
+
const MANIFEST_FILENAME = 'mf-manifest.json';
|
|
12
|
+
export { ASYNC_REQUIRE, DEFAULT_ENTRY_FILENAME, GET_DEV_SERVER_REGEX, HMR_CLIENT_REGEX, INIT_HOST, MANIFEST_FILENAME, PLUGIN_IDENTIFIER, REMOTE_HMR_SETUP, REMOTE_MODULE_REGISTRY, TMP_DIR_NAME };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModuleFederationConfigNormalized } from '../types';
|
|
2
|
+
export declare function getRemoteModule(name: string): string;
|
|
3
|
+
export declare function getHostEntryModule(_: ModuleFederationConfigNormalized, paths: {
|
|
4
|
+
originalEntry: string;
|
|
5
|
+
tmpDir: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function getInitHostModule(options: ModuleFederationConfigNormalized): string;
|
|
8
|
+
export declare function getRemoteEntryModule(options: ModuleFederationConfigNormalized, paths: {
|
|
9
|
+
tmpDir: string;
|
|
10
|
+
projectDir: string;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function getRemoteModuleRegistryModule(): string;
|
|
13
|
+
export declare function getRemoteHMRSetupModule(): string;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
getHostEntryModule: ()=>getHostEntryModule,
|
|
41
|
+
getInitHostModule: ()=>getInitHostModule,
|
|
42
|
+
getRemoteEntryModule: ()=>getRemoteEntryModule,
|
|
43
|
+
getRemoteHMRSetupModule: ()=>getRemoteHMRSetupModule,
|
|
44
|
+
getRemoteModule: ()=>getRemoteModule,
|
|
45
|
+
getRemoteModuleRegistryModule: ()=>getRemoteModuleRegistryModule
|
|
46
|
+
});
|
|
47
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
48
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
49
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
50
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
51
|
+
const external_helpers_js_namespaceObject = require("./helpers.js");
|
|
52
|
+
function getRemoteModule(name) {
|
|
53
|
+
const template = getModuleTemplate('remote-module.js');
|
|
54
|
+
return template.replaceAll('__MODULE_ID__', `"${name}"`);
|
|
55
|
+
}
|
|
56
|
+
function getHostEntryModule(_, paths) {
|
|
57
|
+
const template = getModuleTemplate('host-entry.js');
|
|
58
|
+
const relativeEntryPath = (0, external_helpers_js_namespaceObject.toPosixPath)(external_node_path_default().relative(paths.tmpDir, paths.originalEntry));
|
|
59
|
+
return template.replaceAll('__ENTRYPOINT_IMPORT__', `import './${relativeEntryPath}'`);
|
|
60
|
+
}
|
|
61
|
+
function getInitHostModule(options) {
|
|
62
|
+
const template = getModuleTemplate('init-host.js');
|
|
63
|
+
return template.replaceAll('__NAME__', JSON.stringify(options.name)).replaceAll('__REMOTES__', generateRemotes(options.remotes)).replaceAll('__SHARED__', generateShared(options)).replaceAll('__SHARE_STRATEGY__', JSON.stringify(options.shareStrategy)).replaceAll('__PLUGINS__', generateRuntimePlugins(options.plugins));
|
|
64
|
+
}
|
|
65
|
+
function getRemoteEntryModule(options, paths) {
|
|
66
|
+
const template = getModuleTemplate('remote-entry.js');
|
|
67
|
+
return template.replaceAll('__NAME__', JSON.stringify(options.name)).replaceAll('__EXPOSES_MAP__', generateExposes(options.exposes, paths)).replaceAll('__REMOTES__', generateRemotes(options.remotes)).replaceAll('__SHARED__', generateShared(options)).replaceAll('__SHARE_STRATEGY__', JSON.stringify(options.shareStrategy)).replaceAll('__PLUGINS__', generateRuntimePlugins(options.plugins));
|
|
68
|
+
}
|
|
69
|
+
function getRemoteModuleRegistryModule() {
|
|
70
|
+
const template = getModuleTemplate('remote-module-registry.js');
|
|
71
|
+
return template.replaceAll('__EARLY_MODULE_TEST__', '/^react(-native(\\/|$)|$)/');
|
|
72
|
+
}
|
|
73
|
+
function getRemoteHMRSetupModule() {
|
|
74
|
+
const template = getModuleTemplate('remote-hmr.js');
|
|
75
|
+
return template;
|
|
76
|
+
}
|
|
77
|
+
function generateExposes(exposes, paths) {
|
|
78
|
+
const exposesString = Object.keys(exposes).map((key)=>{
|
|
79
|
+
const importPath = external_node_path_default().join(paths.projectDir, exposes[key]);
|
|
80
|
+
const relativeImportPath = (0, external_helpers_js_namespaceObject.toPosixPath)(external_node_path_default().relative(paths.tmpDir, importPath));
|
|
81
|
+
return `"${key}": async () => import("${relativeImportPath}")`;
|
|
82
|
+
});
|
|
83
|
+
return `{${exposesString.join(',')}}`;
|
|
84
|
+
}
|
|
85
|
+
function generateRuntimePlugins(runtimePlugins) {
|
|
86
|
+
const pluginNames = [];
|
|
87
|
+
const pluginImports = [];
|
|
88
|
+
runtimePlugins.forEach((plugin, index)=>{
|
|
89
|
+
const pluginName = `plugin${index}`;
|
|
90
|
+
pluginNames.push(`${pluginName}()`);
|
|
91
|
+
const pluginPath = (0, external_helpers_js_namespaceObject.toPosixPath)(plugin);
|
|
92
|
+
pluginImports.push(`import ${pluginName} from "${pluginPath}";`);
|
|
93
|
+
});
|
|
94
|
+
const imports = pluginImports.join('\n');
|
|
95
|
+
const plugins = `const plugins = [${pluginNames.join(', ')}];`;
|
|
96
|
+
return `${imports}\n${plugins}`;
|
|
97
|
+
}
|
|
98
|
+
function generateRemotes(remotes = {}) {
|
|
99
|
+
const remotesEntries = [];
|
|
100
|
+
for (const [remoteAlias, remoteEntry] of Object.entries(remotes)){
|
|
101
|
+
const remoteEntryParts = remoteEntry.split('@');
|
|
102
|
+
const remoteName = remoteEntryParts[0];
|
|
103
|
+
const remoteEntryUrl = remoteEntryParts.slice(1).join('@');
|
|
104
|
+
remotesEntries.push(`{
|
|
105
|
+
alias: ${JSON.stringify(remoteAlias)},
|
|
106
|
+
name: ${JSON.stringify(remoteName)},
|
|
107
|
+
entry: ${JSON.stringify(remoteEntryUrl)},
|
|
108
|
+
entryGlobalName: ${JSON.stringify(remoteName)},
|
|
109
|
+
type: "var"
|
|
110
|
+
}`);
|
|
111
|
+
}
|
|
112
|
+
return `[${remotesEntries.join(',\n')}]`;
|
|
113
|
+
}
|
|
114
|
+
function generateShared(options) {
|
|
115
|
+
const shared = Object.keys(options.shared).reduce((acc, name)=>{
|
|
116
|
+
acc[name] = `__SHARED_${name}__`;
|
|
117
|
+
return acc;
|
|
118
|
+
}, {});
|
|
119
|
+
let sharedString = JSON.stringify(shared);
|
|
120
|
+
for (const name of Object.keys(options.shared)){
|
|
121
|
+
const sharedConfig = options.shared[name];
|
|
122
|
+
const entry = getSharedModuleEntry(name, sharedConfig);
|
|
123
|
+
sharedString = sharedString.replaceAll(`"__SHARED_${name}__"`, entry);
|
|
124
|
+
}
|
|
125
|
+
return sharedString;
|
|
126
|
+
}
|
|
127
|
+
function getSharedModuleEntry(name, options) {
|
|
128
|
+
const template = {
|
|
129
|
+
version: options.version,
|
|
130
|
+
scope: 'default',
|
|
131
|
+
shareConfig: {
|
|
132
|
+
singleton: options.singleton,
|
|
133
|
+
eager: options.eager,
|
|
134
|
+
requiredVersion: options.requiredVersion
|
|
135
|
+
},
|
|
136
|
+
get: options.eager ? '__GET_SYNC_PLACEHOLDER__' : '__GET_ASYNC_PLACEHOLDER__'
|
|
137
|
+
};
|
|
138
|
+
const templateString = JSON.stringify(template);
|
|
139
|
+
return templateString.replaceAll('"__GET_SYNC_PLACEHOLDER__"', `() => () => require("${name}")`).replaceAll('"__GET_ASYNC_PLACEHOLDER__"', `async () => import("${name}").then((m) => () => m)`);
|
|
140
|
+
}
|
|
141
|
+
function resolveRuntimeModule(moduleName) {
|
|
142
|
+
return require.resolve(`../runtime/${moduleName}`);
|
|
143
|
+
}
|
|
144
|
+
function getModuleTemplate(moduleName) {
|
|
145
|
+
const templatePath = resolveRuntimeModule(moduleName);
|
|
146
|
+
return external_node_fs_default().readFileSync(templatePath, 'utf-8');
|
|
147
|
+
}
|
|
148
|
+
exports.getHostEntryModule = __webpack_exports__.getHostEntryModule;
|
|
149
|
+
exports.getInitHostModule = __webpack_exports__.getInitHostModule;
|
|
150
|
+
exports.getRemoteEntryModule = __webpack_exports__.getRemoteEntryModule;
|
|
151
|
+
exports.getRemoteHMRSetupModule = __webpack_exports__.getRemoteHMRSetupModule;
|
|
152
|
+
exports.getRemoteModule = __webpack_exports__.getRemoteModule;
|
|
153
|
+
exports.getRemoteModuleRegistryModule = __webpack_exports__.getRemoteModuleRegistryModule;
|
|
154
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
155
|
+
"getHostEntryModule",
|
|
156
|
+
"getInitHostModule",
|
|
157
|
+
"getRemoteEntryModule",
|
|
158
|
+
"getRemoteHMRSetupModule",
|
|
159
|
+
"getRemoteModule",
|
|
160
|
+
"getRemoteModuleRegistryModule"
|
|
161
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
162
|
+
Object.defineProperty(exports, '__esModule', {
|
|
163
|
+
value: true
|
|
164
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import __rslib_shim_module__ from "node:module";
|
|
2
|
+
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
|
+
import node_fs from "node:fs";
|
|
4
|
+
import node_path from "node:path";
|
|
5
|
+
import { toPosixPath } from "./helpers.mjs";
|
|
6
|
+
function getRemoteModule(name) {
|
|
7
|
+
const template = getModuleTemplate('remote-module.js');
|
|
8
|
+
return template.replaceAll('__MODULE_ID__', `"${name}"`);
|
|
9
|
+
}
|
|
10
|
+
function getHostEntryModule(_, paths) {
|
|
11
|
+
const template = getModuleTemplate('host-entry.js');
|
|
12
|
+
const relativeEntryPath = toPosixPath(node_path.relative(paths.tmpDir, paths.originalEntry));
|
|
13
|
+
return template.replaceAll('__ENTRYPOINT_IMPORT__', `import './${relativeEntryPath}'`);
|
|
14
|
+
}
|
|
15
|
+
function getInitHostModule(options) {
|
|
16
|
+
const template = getModuleTemplate('init-host.js');
|
|
17
|
+
return template.replaceAll('__NAME__', JSON.stringify(options.name)).replaceAll('__REMOTES__', generateRemotes(options.remotes)).replaceAll('__SHARED__', generateShared(options)).replaceAll('__SHARE_STRATEGY__', JSON.stringify(options.shareStrategy)).replaceAll('__PLUGINS__', generateRuntimePlugins(options.plugins));
|
|
18
|
+
}
|
|
19
|
+
function getRemoteEntryModule(options, paths) {
|
|
20
|
+
const template = getModuleTemplate('remote-entry.js');
|
|
21
|
+
return template.replaceAll('__NAME__', JSON.stringify(options.name)).replaceAll('__EXPOSES_MAP__', generateExposes(options.exposes, paths)).replaceAll('__REMOTES__', generateRemotes(options.remotes)).replaceAll('__SHARED__', generateShared(options)).replaceAll('__SHARE_STRATEGY__', JSON.stringify(options.shareStrategy)).replaceAll('__PLUGINS__', generateRuntimePlugins(options.plugins));
|
|
22
|
+
}
|
|
23
|
+
function getRemoteModuleRegistryModule() {
|
|
24
|
+
const template = getModuleTemplate('remote-module-registry.js');
|
|
25
|
+
return template.replaceAll('__EARLY_MODULE_TEST__', '/^react(-native(\\/|$)|$)/');
|
|
26
|
+
}
|
|
27
|
+
function getRemoteHMRSetupModule() {
|
|
28
|
+
const template = getModuleTemplate('remote-hmr.js');
|
|
29
|
+
return template;
|
|
30
|
+
}
|
|
31
|
+
function generateExposes(exposes, paths) {
|
|
32
|
+
const exposesString = Object.keys(exposes).map((key)=>{
|
|
33
|
+
const importPath = node_path.join(paths.projectDir, exposes[key]);
|
|
34
|
+
const relativeImportPath = toPosixPath(node_path.relative(paths.tmpDir, importPath));
|
|
35
|
+
return `"${key}": async () => import("${relativeImportPath}")`;
|
|
36
|
+
});
|
|
37
|
+
return `{${exposesString.join(',')}}`;
|
|
38
|
+
}
|
|
39
|
+
function generateRuntimePlugins(runtimePlugins) {
|
|
40
|
+
const pluginNames = [];
|
|
41
|
+
const pluginImports = [];
|
|
42
|
+
runtimePlugins.forEach((plugin, index)=>{
|
|
43
|
+
const pluginName = `plugin${index}`;
|
|
44
|
+
pluginNames.push(`${pluginName}()`);
|
|
45
|
+
const pluginPath = toPosixPath(plugin);
|
|
46
|
+
pluginImports.push(`import ${pluginName} from "${pluginPath}";`);
|
|
47
|
+
});
|
|
48
|
+
const imports = pluginImports.join('\n');
|
|
49
|
+
const plugins = `const plugins = [${pluginNames.join(', ')}];`;
|
|
50
|
+
return `${imports}\n${plugins}`;
|
|
51
|
+
}
|
|
52
|
+
function generateRemotes(remotes = {}) {
|
|
53
|
+
const remotesEntries = [];
|
|
54
|
+
for (const [remoteAlias, remoteEntry] of Object.entries(remotes)){
|
|
55
|
+
const remoteEntryParts = remoteEntry.split('@');
|
|
56
|
+
const remoteName = remoteEntryParts[0];
|
|
57
|
+
const remoteEntryUrl = remoteEntryParts.slice(1).join('@');
|
|
58
|
+
remotesEntries.push(`{
|
|
59
|
+
alias: ${JSON.stringify(remoteAlias)},
|
|
60
|
+
name: ${JSON.stringify(remoteName)},
|
|
61
|
+
entry: ${JSON.stringify(remoteEntryUrl)},
|
|
62
|
+
entryGlobalName: ${JSON.stringify(remoteName)},
|
|
63
|
+
type: "var"
|
|
64
|
+
}`);
|
|
65
|
+
}
|
|
66
|
+
return `[${remotesEntries.join(',\n')}]`;
|
|
67
|
+
}
|
|
68
|
+
function generateShared(options) {
|
|
69
|
+
const shared = Object.keys(options.shared).reduce((acc, name)=>{
|
|
70
|
+
acc[name] = `__SHARED_${name}__`;
|
|
71
|
+
return acc;
|
|
72
|
+
}, {});
|
|
73
|
+
let sharedString = JSON.stringify(shared);
|
|
74
|
+
for (const name of Object.keys(options.shared)){
|
|
75
|
+
const sharedConfig = options.shared[name];
|
|
76
|
+
const entry = getSharedModuleEntry(name, sharedConfig);
|
|
77
|
+
sharedString = sharedString.replaceAll(`"__SHARED_${name}__"`, entry);
|
|
78
|
+
}
|
|
79
|
+
return sharedString;
|
|
80
|
+
}
|
|
81
|
+
function getSharedModuleEntry(name, options) {
|
|
82
|
+
const template = {
|
|
83
|
+
version: options.version,
|
|
84
|
+
scope: 'default',
|
|
85
|
+
shareConfig: {
|
|
86
|
+
singleton: options.singleton,
|
|
87
|
+
eager: options.eager,
|
|
88
|
+
requiredVersion: options.requiredVersion
|
|
89
|
+
},
|
|
90
|
+
get: options.eager ? '__GET_SYNC_PLACEHOLDER__' : '__GET_ASYNC_PLACEHOLDER__'
|
|
91
|
+
};
|
|
92
|
+
const templateString = JSON.stringify(template);
|
|
93
|
+
return templateString.replaceAll('"__GET_SYNC_PLACEHOLDER__"', `() => () => require("${name}")`).replaceAll('"__GET_ASYNC_PLACEHOLDER__"', `async () => import("${name}").then((m) => () => m)`);
|
|
94
|
+
}
|
|
95
|
+
function resolveRuntimeModule(moduleName) {
|
|
96
|
+
return require.resolve(`../runtime/${moduleName}`);
|
|
97
|
+
}
|
|
98
|
+
function getModuleTemplate(moduleName) {
|
|
99
|
+
const templatePath = resolveRuntimeModule(moduleName);
|
|
100
|
+
return node_fs.readFileSync(templatePath, 'utf-8');
|
|
101
|
+
}
|
|
102
|
+
export { getHostEntryModule, getInitHostModule, getRemoteEntryModule, getRemoteHMRSetupModule, getRemoteModule, getRemoteModuleRegistryModule };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isUsingMFCommand(command?: string): boolean;
|
|
2
|
+
export declare function isUsingMFBundleCommand(command?: string): boolean;
|
|
3
|
+
export declare function replaceExtension(filepath: string, extension: string): string;
|
|
4
|
+
export declare function removeExtension(filepath: string): string;
|
|
5
|
+
export declare function stubHostEntry(hostEntryPath: string): void;
|
|
6
|
+
export declare function stubRemoteEntry(remoteEntryPath: string): void;
|
|
7
|
+
export declare function prepareTmpDir(projectRootPath: string): string;
|
|
8
|
+
export declare function toPosixPath(value: string): string;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
isUsingMFBundleCommand: ()=>isUsingMFBundleCommand,
|
|
41
|
+
isUsingMFCommand: ()=>isUsingMFCommand,
|
|
42
|
+
prepareTmpDir: ()=>prepareTmpDir,
|
|
43
|
+
removeExtension: ()=>removeExtension,
|
|
44
|
+
replaceExtension: ()=>replaceExtension,
|
|
45
|
+
stubHostEntry: ()=>stubHostEntry,
|
|
46
|
+
stubRemoteEntry: ()=>stubRemoteEntry,
|
|
47
|
+
toPosixPath: ()=>toPosixPath
|
|
48
|
+
});
|
|
49
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
50
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
51
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
52
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
53
|
+
const external_constants_js_namespaceObject = require("./constants.js");
|
|
54
|
+
function isUsingMFCommand(command = process.argv[2]) {
|
|
55
|
+
const allowedCommands = [
|
|
56
|
+
'start',
|
|
57
|
+
'bundle-mf-host',
|
|
58
|
+
'bundle-mf-remote'
|
|
59
|
+
];
|
|
60
|
+
return allowedCommands.includes(command);
|
|
61
|
+
}
|
|
62
|
+
function isUsingMFBundleCommand(command = process.argv[2]) {
|
|
63
|
+
const allowedCommands = [
|
|
64
|
+
'bundle-mf-host',
|
|
65
|
+
'bundle-mf-remote'
|
|
66
|
+
];
|
|
67
|
+
return allowedCommands.includes(command);
|
|
68
|
+
}
|
|
69
|
+
function replaceExtension(filepath, extension) {
|
|
70
|
+
const separatorIndex = Math.max(filepath.lastIndexOf('/'), filepath.lastIndexOf('\\'));
|
|
71
|
+
const dotIndex = filepath.lastIndexOf('.');
|
|
72
|
+
const extensionStart = dotIndex > separatorIndex + 1 ? dotIndex : filepath.length;
|
|
73
|
+
return `${filepath.slice(0, extensionStart)}${extension}`;
|
|
74
|
+
}
|
|
75
|
+
function removeExtension(filepath) {
|
|
76
|
+
return replaceExtension(filepath, '');
|
|
77
|
+
}
|
|
78
|
+
function stubHostEntry(hostEntryPath) {
|
|
79
|
+
const stub = '// host entry stub';
|
|
80
|
+
external_node_fs_default().mkdirSync(external_node_path_default().dirname(hostEntryPath), {
|
|
81
|
+
recursive: true
|
|
82
|
+
});
|
|
83
|
+
external_node_fs_default().writeFileSync(hostEntryPath, stub, 'utf-8');
|
|
84
|
+
}
|
|
85
|
+
function stubRemoteEntry(remoteEntryPath) {
|
|
86
|
+
const stub = '// remote entry stub';
|
|
87
|
+
external_node_fs_default().mkdirSync(external_node_path_default().dirname(remoteEntryPath), {
|
|
88
|
+
recursive: true
|
|
89
|
+
});
|
|
90
|
+
external_node_fs_default().writeFileSync(remoteEntryPath, stub, 'utf-8');
|
|
91
|
+
}
|
|
92
|
+
function prepareTmpDir(projectRootPath) {
|
|
93
|
+
const nodeModulesPath = external_node_path_default().resolve(projectRootPath, 'node_modules');
|
|
94
|
+
const tmpDirPath = external_node_path_default().join(nodeModulesPath, external_constants_js_namespaceObject.TMP_DIR_NAME);
|
|
95
|
+
external_node_fs_default().rmSync(tmpDirPath, {
|
|
96
|
+
recursive: true,
|
|
97
|
+
force: true
|
|
98
|
+
});
|
|
99
|
+
external_node_fs_default().mkdirSync(tmpDirPath, {
|
|
100
|
+
recursive: true
|
|
101
|
+
});
|
|
102
|
+
return tmpDirPath;
|
|
103
|
+
}
|
|
104
|
+
function toPosixPath(value) {
|
|
105
|
+
return value.replaceAll('\\', '/');
|
|
106
|
+
}
|
|
107
|
+
exports.isUsingMFBundleCommand = __webpack_exports__.isUsingMFBundleCommand;
|
|
108
|
+
exports.isUsingMFCommand = __webpack_exports__.isUsingMFCommand;
|
|
109
|
+
exports.prepareTmpDir = __webpack_exports__.prepareTmpDir;
|
|
110
|
+
exports.removeExtension = __webpack_exports__.removeExtension;
|
|
111
|
+
exports.replaceExtension = __webpack_exports__.replaceExtension;
|
|
112
|
+
exports.stubHostEntry = __webpack_exports__.stubHostEntry;
|
|
113
|
+
exports.stubRemoteEntry = __webpack_exports__.stubRemoteEntry;
|
|
114
|
+
exports.toPosixPath = __webpack_exports__.toPosixPath;
|
|
115
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
116
|
+
"isUsingMFBundleCommand",
|
|
117
|
+
"isUsingMFCommand",
|
|
118
|
+
"prepareTmpDir",
|
|
119
|
+
"removeExtension",
|
|
120
|
+
"replaceExtension",
|
|
121
|
+
"stubHostEntry",
|
|
122
|
+
"stubRemoteEntry",
|
|
123
|
+
"toPosixPath"
|
|
124
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
125
|
+
Object.defineProperty(exports, '__esModule', {
|
|
126
|
+
value: true
|
|
127
|
+
});
|