@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,12 @@
|
|
|
1
|
+
import type { ModuleFederationConfigNormalized } from '../../types';
|
|
2
|
+
import type { Config } from '../types';
|
|
3
|
+
import type { BundleFederatedRemoteArgs } from './types';
|
|
4
|
+
declare global {
|
|
5
|
+
var __METRO_FEDERATION_CONFIG: ModuleFederationConfigNormalized;
|
|
6
|
+
var __METRO_FEDERATION_ORIGINAL_ENTRY_PATH: string | undefined;
|
|
7
|
+
var __METRO_FEDERATION_REMOTE_ENTRY_PATH: string | undefined;
|
|
8
|
+
var __METRO_FEDERATION_MANIFEST_PATH: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
declare function bundleFederatedRemote(_argv: Array<string>, cfg: Config, args: BundleFederatedRemoteArgs): Promise<void>;
|
|
11
|
+
export default bundleFederatedRemote;
|
|
12
|
+
export { default as bundleFederatedRemoteOptions } from './options';
|
|
@@ -0,0 +1,241 @@
|
|
|
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
|
+
bundleFederatedRemoteOptions: ()=>external_options_js_default(),
|
|
41
|
+
default: ()=>bundle_remote
|
|
42
|
+
});
|
|
43
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
44
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
45
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
46
|
+
const external_node_util_namespaceObject = require("node:util");
|
|
47
|
+
var external_node_util_default = /*#__PURE__*/ __webpack_require__.n(external_node_util_namespaceObject);
|
|
48
|
+
const external_metro_namespaceObject = require("metro");
|
|
49
|
+
const errors_js_namespaceObject = require("../../utils/errors.js");
|
|
50
|
+
const federated_remote_types_js_namespaceObject = require("../../utils/federated-remote-types.js");
|
|
51
|
+
const metro_compat_js_namespaceObject = require("../../utils/metro-compat.js");
|
|
52
|
+
const create_module_path_remapper_js_namespaceObject = require("../utils/create-module-path-remapper.js");
|
|
53
|
+
const create_resolver_js_namespaceObject = require("../utils/create-resolver.js");
|
|
54
|
+
const load_metro_config_js_namespaceObject = require("../utils/load-metro-config.js");
|
|
55
|
+
var load_metro_config_js_default = /*#__PURE__*/ __webpack_require__.n(load_metro_config_js_namespaceObject);
|
|
56
|
+
const path_utils_js_namespaceObject = require("../utils/path-utils.js");
|
|
57
|
+
const save_bundle_and_map_js_namespaceObject = require("../utils/save-bundle-and-map.js");
|
|
58
|
+
const helpers_js_namespaceObject = require("../../plugin/helpers.js");
|
|
59
|
+
const external_options_js_namespaceObject = require("./options.js");
|
|
60
|
+
var external_options_js_default = /*#__PURE__*/ __webpack_require__.n(external_options_js_namespaceObject);
|
|
61
|
+
const DEFAULT_OUTPUT = 'dist';
|
|
62
|
+
async function buildBundle(server, requestOpts) {
|
|
63
|
+
const bundle = await server.build({
|
|
64
|
+
...metro_compat_js_namespaceObject.Server.DEFAULT_BUNDLE_OPTIONS,
|
|
65
|
+
...requestOpts
|
|
66
|
+
});
|
|
67
|
+
return bundle;
|
|
68
|
+
}
|
|
69
|
+
function getRequestOpts(args, opts) {
|
|
70
|
+
return {
|
|
71
|
+
dev: args.dev,
|
|
72
|
+
minify: void 0 !== args.minify ? args.minify : !args.dev,
|
|
73
|
+
platform: args.platform,
|
|
74
|
+
entryFile: opts.entryFile,
|
|
75
|
+
sourceUrl: opts.sourceUrl,
|
|
76
|
+
sourceMapUrl: opts.sourceMapUrl,
|
|
77
|
+
lazy: opts.isContainerModule,
|
|
78
|
+
runModule: opts.isContainerModule,
|
|
79
|
+
modulesOnly: !opts.isContainerModule
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function getSaveBundleOpts(args, opts) {
|
|
83
|
+
return {
|
|
84
|
+
indexedRamBundle: false,
|
|
85
|
+
bundleEncoding: args.bundleEncoding,
|
|
86
|
+
dev: args.dev,
|
|
87
|
+
platform: args.platform,
|
|
88
|
+
sourcemapSourcesRoot: args.sourcemapSourcesRoot,
|
|
89
|
+
sourcemapUseAbsolutePath: args.sourcemapUseAbsolutePath,
|
|
90
|
+
bundleOutput: opts.bundleOutput,
|
|
91
|
+
sourcemapOutput: opts.sourcemapOutput
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async function bundleFederatedRemote(_argv, cfg, args) {
|
|
95
|
+
const rawConfig = await load_metro_config_js_default()(cfg, {
|
|
96
|
+
maxWorkers: args.maxWorkers,
|
|
97
|
+
resetCache: args.resetCache,
|
|
98
|
+
config: args.config
|
|
99
|
+
});
|
|
100
|
+
const logger = cfg.logger ?? console;
|
|
101
|
+
const federationConfig = global.__METRO_FEDERATION_CONFIG;
|
|
102
|
+
if (!federationConfig) {
|
|
103
|
+
logger.error(`${external_node_util_default().styleText('red', 'error')} Module Federation configuration is missing.`);
|
|
104
|
+
logger.info("Import the plugin 'withModuleFederation' from '@module-federation/metro' package and wrap your final Metro config with it.");
|
|
105
|
+
throw new errors_js_namespaceObject.CLIError('Bundling failed');
|
|
106
|
+
}
|
|
107
|
+
const containerEntryFilepath = global.__METRO_FEDERATION_REMOTE_ENTRY_PATH;
|
|
108
|
+
if (!containerEntryFilepath) {
|
|
109
|
+
logger.error(`${external_node_util_default().styleText('red', 'error')} Cannot determine the container entry file path.`);
|
|
110
|
+
logger.info("To bundle a container, you need to expose at least one module in your Module Federation configuration.");
|
|
111
|
+
throw new errors_js_namespaceObject.CLIError('Bundling failed');
|
|
112
|
+
}
|
|
113
|
+
const manifestFilepath = global.__METRO_FEDERATION_MANIFEST_PATH;
|
|
114
|
+
if (!manifestFilepath) {
|
|
115
|
+
logger.error(`${external_node_util_default().styleText('red', 'error')} Cannot determine the manifest file path.`);
|
|
116
|
+
throw new errors_js_namespaceObject.CLIError('Bundling failed');
|
|
117
|
+
}
|
|
118
|
+
if (-1 === rawConfig.resolver.platforms.indexOf(args.platform)) {
|
|
119
|
+
logger.error(`${external_node_util_default().styleText('red', 'error')}: Invalid platform ${args.platform ? `"${external_node_util_default().styleText('bold', args.platform)}" ` : ''}selected.`);
|
|
120
|
+
logger.info(`Available platforms are: ${rawConfig.resolver.platforms.map((x)=>`"${external_node_util_default().styleText('bold', x)}"`).join(', ')}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`);
|
|
121
|
+
throw new errors_js_namespaceObject.CLIError('Bundling failed');
|
|
122
|
+
}
|
|
123
|
+
process.env.NODE_ENV = args.dev ? 'development' : 'production';
|
|
124
|
+
const modulePathRemapper = (0, create_module_path_remapper_js_namespaceObject.createModulePathRemapper)();
|
|
125
|
+
const config = (0, external_metro_namespaceObject.mergeConfig)(rawConfig, {
|
|
126
|
+
resolver: {
|
|
127
|
+
resolveRequest: (context, moduleName, platform)=>{
|
|
128
|
+
const originalResolveRequest = rawConfig.resolver.resolveRequest;
|
|
129
|
+
const res = originalResolveRequest(context, moduleName, platform);
|
|
130
|
+
return modulePathRemapper.remap(res);
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
serializer: {
|
|
134
|
+
createModuleIdFactory: ()=>{
|
|
135
|
+
const factory = rawConfig.serializer.createModuleIdFactory();
|
|
136
|
+
return (path)=>factory(modulePathRemapper.reverse(path));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const server = new metro_compat_js_namespaceObject.Server(config);
|
|
141
|
+
config.server.enhanceMiddleware(server.processRequest, server);
|
|
142
|
+
const resolver = await (0, create_resolver_js_namespaceObject.createResolver)(server, args.platform);
|
|
143
|
+
const outputDir = args.output ? external_node_path_default().resolve(external_node_path_default().join(args.output, args.platform)) : external_node_path_default().resolve(config.projectRoot, external_node_path_default().join(DEFAULT_OUTPUT, args.platform));
|
|
144
|
+
const containerModule = {
|
|
145
|
+
[federationConfig.filename]: {
|
|
146
|
+
moduleInputFilepath: containerEntryFilepath,
|
|
147
|
+
moduleOutputDir: outputDir,
|
|
148
|
+
isContainerModule: true
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const relativeContainerEntryPath = (0, helpers_js_namespaceObject.toPosixPath)(external_node_path_default().relative(config.projectRoot, containerEntryFilepath));
|
|
152
|
+
resolver.resolve({
|
|
153
|
+
from: config.projectRoot,
|
|
154
|
+
to: `./${relativeContainerEntryPath}`
|
|
155
|
+
});
|
|
156
|
+
const exposedModules = Object.entries(federationConfig.exposes).map(([moduleName, moduleFilepath])=>[
|
|
157
|
+
moduleName.slice(2),
|
|
158
|
+
moduleFilepath
|
|
159
|
+
]).reduce((acc, [moduleName, moduleInputFilepath])=>{
|
|
160
|
+
acc[moduleName] = {
|
|
161
|
+
moduleInputFilepath: external_node_path_default().resolve(config.projectRoot, moduleInputFilepath),
|
|
162
|
+
moduleOutputDir: external_node_path_default().resolve(outputDir, 'exposed'),
|
|
163
|
+
isContainerModule: false
|
|
164
|
+
};
|
|
165
|
+
return acc;
|
|
166
|
+
}, {});
|
|
167
|
+
const sharedModules = Object.entries(federationConfig.shared).filter(([, sharedConfig])=>!sharedConfig.eager && false !== sharedConfig.import).reduce((acc, [moduleName])=>{
|
|
168
|
+
const inputFilepath = resolver.resolve({
|
|
169
|
+
from: containerEntryFilepath,
|
|
170
|
+
to: moduleName
|
|
171
|
+
});
|
|
172
|
+
acc[moduleName] = {
|
|
173
|
+
moduleInputFilepath: inputFilepath,
|
|
174
|
+
moduleOutputDir: external_node_path_default().resolve(outputDir, 'shared'),
|
|
175
|
+
isContainerModule: false
|
|
176
|
+
};
|
|
177
|
+
return acc;
|
|
178
|
+
}, {});
|
|
179
|
+
const requests = Object.entries({
|
|
180
|
+
...containerModule,
|
|
181
|
+
...exposedModules,
|
|
182
|
+
...sharedModules
|
|
183
|
+
}).map(([moduleName, { moduleInputFilepath, moduleOutputDir, isContainerModule = false }])=>{
|
|
184
|
+
const moduleBundleName = isContainerModule ? moduleName : `${moduleName}.bundle`;
|
|
185
|
+
const moduleBundleFilepath = external_node_path_default().resolve(moduleOutputDir, moduleBundleName);
|
|
186
|
+
const relativeModuleBundlePath = (0, path_utils_js_namespaceObject.normalizeOutputRelativePath)(external_node_path_default().relative(outputDir, moduleBundleFilepath));
|
|
187
|
+
const moduleBundleUrl = (0, path_utils_js_namespaceObject.toFileSourceUrl)(relativeModuleBundlePath);
|
|
188
|
+
const moduleSourceMapName = `${moduleBundleName}.map`;
|
|
189
|
+
const moduleSourceMapFilepath = external_node_path_default().resolve(moduleOutputDir, moduleSourceMapName);
|
|
190
|
+
const moduleSourceMapUrl = (0, path_utils_js_namespaceObject.normalizeOutputRelativePath)(external_node_path_default().relative(outputDir, moduleSourceMapFilepath));
|
|
191
|
+
if (!isContainerModule) modulePathRemapper.addMapping(moduleInputFilepath, relativeModuleBundlePath);
|
|
192
|
+
return {
|
|
193
|
+
targetDir: external_node_path_default().dirname(moduleBundleFilepath),
|
|
194
|
+
requestOpts: getRequestOpts(args, {
|
|
195
|
+
isContainerModule,
|
|
196
|
+
entryFile: moduleInputFilepath,
|
|
197
|
+
sourceUrl: moduleBundleUrl,
|
|
198
|
+
sourceMapUrl: moduleSourceMapUrl
|
|
199
|
+
}),
|
|
200
|
+
saveBundleOpts: getSaveBundleOpts(args, {
|
|
201
|
+
bundleOutput: moduleBundleFilepath,
|
|
202
|
+
sourcemapOutput: moduleSourceMapFilepath
|
|
203
|
+
})
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
try {
|
|
207
|
+
logger.info(`${external_node_util_default().styleText('blue', 'Processing remote container and exposed modules')}`);
|
|
208
|
+
for (const { requestOpts, saveBundleOpts, targetDir } of requests){
|
|
209
|
+
await external_node_fs_namespaceObject.promises.mkdir(targetDir, {
|
|
210
|
+
recursive: true,
|
|
211
|
+
mode: 493
|
|
212
|
+
});
|
|
213
|
+
const bundle = await buildBundle(server, requestOpts);
|
|
214
|
+
await (0, save_bundle_and_map_js_namespaceObject.saveBundleAndMap)(bundle, saveBundleOpts, logger.info);
|
|
215
|
+
}
|
|
216
|
+
const manifestOutputFilepath = external_node_path_default().resolve(outputDir, 'mf-manifest.json');
|
|
217
|
+
const typesMeta = await (0, federated_remote_types_js_namespaceObject.maybeGenerateFederatedRemoteTypes)({
|
|
218
|
+
federationConfig,
|
|
219
|
+
projectRoot: config.projectRoot,
|
|
220
|
+
outputDir,
|
|
221
|
+
logger
|
|
222
|
+
});
|
|
223
|
+
logger.info(`${external_node_util_default().styleText('blue', 'Processing manifest')}`);
|
|
224
|
+
const rawManifest = JSON.parse(await external_node_fs_namespaceObject.promises.readFile(manifestFilepath, 'utf-8'));
|
|
225
|
+
(0, federated_remote_types_js_namespaceObject.applyTypesMetaToManifest)(rawManifest, typesMeta);
|
|
226
|
+
await external_node_fs_namespaceObject.promises.writeFile(manifestOutputFilepath, JSON.stringify(rawManifest, void 0, 2), 'utf-8');
|
|
227
|
+
logger.info(`Done writing MF Manifest to:\n${external_node_util_default().styleText('dim', manifestOutputFilepath)}`);
|
|
228
|
+
} finally{
|
|
229
|
+
await server.end();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const bundle_remote = bundleFederatedRemote;
|
|
233
|
+
exports.bundleFederatedRemoteOptions = __webpack_exports__.bundleFederatedRemoteOptions;
|
|
234
|
+
exports["default"] = __webpack_exports__["default"];
|
|
235
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
236
|
+
"bundleFederatedRemoteOptions",
|
|
237
|
+
"default"
|
|
238
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
239
|
+
Object.defineProperty(exports, '__esModule', {
|
|
240
|
+
value: true
|
|
241
|
+
});
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { promises } from "node:fs";
|
|
3
|
+
import node_path from "node:path";
|
|
4
|
+
import node_util from "node:util";
|
|
5
|
+
import { CLIError } from "../../utils/errors.mjs";
|
|
6
|
+
import { applyTypesMetaToManifest, maybeGenerateFederatedRemoteTypes } from "../../utils/federated-remote-types.mjs";
|
|
7
|
+
import { Server } from "../../utils/metro-compat.mjs";
|
|
8
|
+
import { createModulePathRemapper } from "../utils/create-module-path-remapper.mjs";
|
|
9
|
+
import { createResolver } from "../utils/create-resolver.mjs";
|
|
10
|
+
import load_metro_config from "../utils/load-metro-config.mjs";
|
|
11
|
+
import { normalizeOutputRelativePath, toFileSourceUrl } from "../utils/path-utils.mjs";
|
|
12
|
+
import { saveBundleAndMap } from "../utils/save-bundle-and-map.mjs";
|
|
13
|
+
import { toPosixPath } from "../../plugin/helpers.mjs";
|
|
14
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
15
|
+
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
16
|
+
const external_metro_namespaceObject = __rspack_createRequire_require("metro");
|
|
17
|
+
const DEFAULT_OUTPUT = 'dist';
|
|
18
|
+
async function buildBundle(server, requestOpts) {
|
|
19
|
+
const bundle = await server.build({
|
|
20
|
+
...Server.DEFAULT_BUNDLE_OPTIONS,
|
|
21
|
+
...requestOpts
|
|
22
|
+
});
|
|
23
|
+
return bundle;
|
|
24
|
+
}
|
|
25
|
+
function getRequestOpts(args, opts) {
|
|
26
|
+
return {
|
|
27
|
+
dev: args.dev,
|
|
28
|
+
minify: void 0 !== args.minify ? args.minify : !args.dev,
|
|
29
|
+
platform: args.platform,
|
|
30
|
+
entryFile: opts.entryFile,
|
|
31
|
+
sourceUrl: opts.sourceUrl,
|
|
32
|
+
sourceMapUrl: opts.sourceMapUrl,
|
|
33
|
+
lazy: opts.isContainerModule,
|
|
34
|
+
runModule: opts.isContainerModule,
|
|
35
|
+
modulesOnly: !opts.isContainerModule
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function getSaveBundleOpts(args, opts) {
|
|
39
|
+
return {
|
|
40
|
+
indexedRamBundle: false,
|
|
41
|
+
bundleEncoding: args.bundleEncoding,
|
|
42
|
+
dev: args.dev,
|
|
43
|
+
platform: args.platform,
|
|
44
|
+
sourcemapSourcesRoot: args.sourcemapSourcesRoot,
|
|
45
|
+
sourcemapUseAbsolutePath: args.sourcemapUseAbsolutePath,
|
|
46
|
+
bundleOutput: opts.bundleOutput,
|
|
47
|
+
sourcemapOutput: opts.sourcemapOutput
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function bundleFederatedRemote(_argv, cfg, args) {
|
|
51
|
+
const rawConfig = await load_metro_config(cfg, {
|
|
52
|
+
maxWorkers: args.maxWorkers,
|
|
53
|
+
resetCache: args.resetCache,
|
|
54
|
+
config: args.config
|
|
55
|
+
});
|
|
56
|
+
const logger = cfg.logger ?? console;
|
|
57
|
+
const federationConfig = global.__METRO_FEDERATION_CONFIG;
|
|
58
|
+
if (!federationConfig) {
|
|
59
|
+
logger.error(`${node_util.styleText('red', 'error')} Module Federation configuration is missing.`);
|
|
60
|
+
logger.info("Import the plugin 'withModuleFederation' from '@module-federation/metro' package and wrap your final Metro config with it.");
|
|
61
|
+
throw new CLIError('Bundling failed');
|
|
62
|
+
}
|
|
63
|
+
const containerEntryFilepath = global.__METRO_FEDERATION_REMOTE_ENTRY_PATH;
|
|
64
|
+
if (!containerEntryFilepath) {
|
|
65
|
+
logger.error(`${node_util.styleText('red', 'error')} Cannot determine the container entry file path.`);
|
|
66
|
+
logger.info("To bundle a container, you need to expose at least one module in your Module Federation configuration.");
|
|
67
|
+
throw new CLIError('Bundling failed');
|
|
68
|
+
}
|
|
69
|
+
const manifestFilepath = global.__METRO_FEDERATION_MANIFEST_PATH;
|
|
70
|
+
if (!manifestFilepath) {
|
|
71
|
+
logger.error(`${node_util.styleText('red', 'error')} Cannot determine the manifest file path.`);
|
|
72
|
+
throw new CLIError('Bundling failed');
|
|
73
|
+
}
|
|
74
|
+
if (-1 === rawConfig.resolver.platforms.indexOf(args.platform)) {
|
|
75
|
+
logger.error(`${node_util.styleText('red', 'error')}: Invalid platform ${args.platform ? `"${node_util.styleText('bold', args.platform)}" ` : ''}selected.`);
|
|
76
|
+
logger.info(`Available platforms are: ${rawConfig.resolver.platforms.map((x)=>`"${node_util.styleText('bold', x)}"`).join(', ')}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`);
|
|
77
|
+
throw new CLIError('Bundling failed');
|
|
78
|
+
}
|
|
79
|
+
process.env.NODE_ENV = args.dev ? 'development' : 'production';
|
|
80
|
+
const modulePathRemapper = createModulePathRemapper();
|
|
81
|
+
const config = (0, external_metro_namespaceObject.mergeConfig)(rawConfig, {
|
|
82
|
+
resolver: {
|
|
83
|
+
resolveRequest: (context, moduleName, platform)=>{
|
|
84
|
+
const originalResolveRequest = rawConfig.resolver.resolveRequest;
|
|
85
|
+
const res = originalResolveRequest(context, moduleName, platform);
|
|
86
|
+
return modulePathRemapper.remap(res);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
serializer: {
|
|
90
|
+
createModuleIdFactory: ()=>{
|
|
91
|
+
const factory = rawConfig.serializer.createModuleIdFactory();
|
|
92
|
+
return (path)=>factory(modulePathRemapper.reverse(path));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const server = new Server(config);
|
|
97
|
+
config.server.enhanceMiddleware(server.processRequest, server);
|
|
98
|
+
const resolver = await createResolver(server, args.platform);
|
|
99
|
+
const outputDir = args.output ? node_path.resolve(node_path.join(args.output, args.platform)) : node_path.resolve(config.projectRoot, node_path.join(DEFAULT_OUTPUT, args.platform));
|
|
100
|
+
const containerModule = {
|
|
101
|
+
[federationConfig.filename]: {
|
|
102
|
+
moduleInputFilepath: containerEntryFilepath,
|
|
103
|
+
moduleOutputDir: outputDir,
|
|
104
|
+
isContainerModule: true
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const relativeContainerEntryPath = toPosixPath(node_path.relative(config.projectRoot, containerEntryFilepath));
|
|
108
|
+
resolver.resolve({
|
|
109
|
+
from: config.projectRoot,
|
|
110
|
+
to: `./${relativeContainerEntryPath}`
|
|
111
|
+
});
|
|
112
|
+
const exposedModules = Object.entries(federationConfig.exposes).map(([moduleName, moduleFilepath])=>[
|
|
113
|
+
moduleName.slice(2),
|
|
114
|
+
moduleFilepath
|
|
115
|
+
]).reduce((acc, [moduleName, moduleInputFilepath])=>{
|
|
116
|
+
acc[moduleName] = {
|
|
117
|
+
moduleInputFilepath: node_path.resolve(config.projectRoot, moduleInputFilepath),
|
|
118
|
+
moduleOutputDir: node_path.resolve(outputDir, 'exposed'),
|
|
119
|
+
isContainerModule: false
|
|
120
|
+
};
|
|
121
|
+
return acc;
|
|
122
|
+
}, {});
|
|
123
|
+
const sharedModules = Object.entries(federationConfig.shared).filter(([, sharedConfig])=>!sharedConfig.eager && false !== sharedConfig.import).reduce((acc, [moduleName])=>{
|
|
124
|
+
const inputFilepath = resolver.resolve({
|
|
125
|
+
from: containerEntryFilepath,
|
|
126
|
+
to: moduleName
|
|
127
|
+
});
|
|
128
|
+
acc[moduleName] = {
|
|
129
|
+
moduleInputFilepath: inputFilepath,
|
|
130
|
+
moduleOutputDir: node_path.resolve(outputDir, 'shared'),
|
|
131
|
+
isContainerModule: false
|
|
132
|
+
};
|
|
133
|
+
return acc;
|
|
134
|
+
}, {});
|
|
135
|
+
const requests = Object.entries({
|
|
136
|
+
...containerModule,
|
|
137
|
+
...exposedModules,
|
|
138
|
+
...sharedModules
|
|
139
|
+
}).map(([moduleName, { moduleInputFilepath, moduleOutputDir, isContainerModule = false }])=>{
|
|
140
|
+
const moduleBundleName = isContainerModule ? moduleName : `${moduleName}.bundle`;
|
|
141
|
+
const moduleBundleFilepath = node_path.resolve(moduleOutputDir, moduleBundleName);
|
|
142
|
+
const relativeModuleBundlePath = normalizeOutputRelativePath(node_path.relative(outputDir, moduleBundleFilepath));
|
|
143
|
+
const moduleBundleUrl = toFileSourceUrl(relativeModuleBundlePath);
|
|
144
|
+
const moduleSourceMapName = `${moduleBundleName}.map`;
|
|
145
|
+
const moduleSourceMapFilepath = node_path.resolve(moduleOutputDir, moduleSourceMapName);
|
|
146
|
+
const moduleSourceMapUrl = normalizeOutputRelativePath(node_path.relative(outputDir, moduleSourceMapFilepath));
|
|
147
|
+
if (!isContainerModule) modulePathRemapper.addMapping(moduleInputFilepath, relativeModuleBundlePath);
|
|
148
|
+
return {
|
|
149
|
+
targetDir: node_path.dirname(moduleBundleFilepath),
|
|
150
|
+
requestOpts: getRequestOpts(args, {
|
|
151
|
+
isContainerModule,
|
|
152
|
+
entryFile: moduleInputFilepath,
|
|
153
|
+
sourceUrl: moduleBundleUrl,
|
|
154
|
+
sourceMapUrl: moduleSourceMapUrl
|
|
155
|
+
}),
|
|
156
|
+
saveBundleOpts: getSaveBundleOpts(args, {
|
|
157
|
+
bundleOutput: moduleBundleFilepath,
|
|
158
|
+
sourcemapOutput: moduleSourceMapFilepath
|
|
159
|
+
})
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
try {
|
|
163
|
+
logger.info(`${node_util.styleText('blue', 'Processing remote container and exposed modules')}`);
|
|
164
|
+
for (const { requestOpts, saveBundleOpts, targetDir } of requests){
|
|
165
|
+
await promises.mkdir(targetDir, {
|
|
166
|
+
recursive: true,
|
|
167
|
+
mode: 493
|
|
168
|
+
});
|
|
169
|
+
const bundle = await buildBundle(server, requestOpts);
|
|
170
|
+
await saveBundleAndMap(bundle, saveBundleOpts, logger.info);
|
|
171
|
+
}
|
|
172
|
+
const manifestOutputFilepath = node_path.resolve(outputDir, 'mf-manifest.json');
|
|
173
|
+
const typesMeta = await maybeGenerateFederatedRemoteTypes({
|
|
174
|
+
federationConfig,
|
|
175
|
+
projectRoot: config.projectRoot,
|
|
176
|
+
outputDir,
|
|
177
|
+
logger
|
|
178
|
+
});
|
|
179
|
+
logger.info(`${node_util.styleText('blue', 'Processing manifest')}`);
|
|
180
|
+
const rawManifest = JSON.parse(await promises.readFile(manifestFilepath, 'utf-8'));
|
|
181
|
+
applyTypesMetaToManifest(rawManifest, typesMeta);
|
|
182
|
+
await promises.writeFile(manifestOutputFilepath, JSON.stringify(rawManifest, void 0, 2), 'utf-8');
|
|
183
|
+
logger.info(`Done writing MF Manifest to:\n${node_util.styleText('dim', manifestOutputFilepath)}`);
|
|
184
|
+
} finally{
|
|
185
|
+
await server.end();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const bundle_remote = bundleFederatedRemote;
|
|
189
|
+
export { default as bundleFederatedRemoteOptions } from "./options.mjs";
|
|
190
|
+
export default bundle_remote;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare const options: ({
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
default: string;
|
|
5
|
+
parse?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
parse: (val: string) => boolean;
|
|
10
|
+
default: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
parse: (val: string) => boolean;
|
|
15
|
+
default?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
default?: undefined;
|
|
20
|
+
parse?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
default: boolean;
|
|
25
|
+
parse?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
parse: (val: string) => string;
|
|
30
|
+
default?: undefined;
|
|
31
|
+
})[];
|
|
32
|
+
export default options;
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
default: ()=>bundle_remote_options
|
|
41
|
+
});
|
|
42
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
43
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
44
|
+
const options = [
|
|
45
|
+
{
|
|
46
|
+
name: '--platform <string>',
|
|
47
|
+
description: 'Either "ios" or "android"',
|
|
48
|
+
default: 'ios'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: '--dev [boolean]',
|
|
52
|
+
description: 'If false, warnings are disabled and the bundle is minified',
|
|
53
|
+
parse: (val)=>'false' !== val,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: '--minify [boolean]',
|
|
58
|
+
description: "Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.",
|
|
59
|
+
parse: (val)=>'false' !== val
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: '--bundle-encoding <string>',
|
|
63
|
+
description: 'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).',
|
|
64
|
+
default: 'utf8'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: '--max-workers <number>',
|
|
68
|
+
description: "Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: '--sourcemap-output <string>',
|
|
72
|
+
description: 'File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: '--sourcemap-sources-root <string>',
|
|
76
|
+
description: "Path to make sourcemap's sources entries relative to, ex. /root/dir"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: '--sourcemap-use-absolute-path',
|
|
80
|
+
description: 'Report SourceMapURL using its full path',
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: '--assets-dest <string>',
|
|
85
|
+
description: 'Directory name where to store assets referenced in the bundle'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: '--asset-catalog-dest [string]',
|
|
89
|
+
description: 'Path where to create an iOS Asset Catalog for images'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: '--reset-cache',
|
|
93
|
+
description: 'Removes cached files',
|
|
94
|
+
default: false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: '--config <string>',
|
|
98
|
+
description: 'Path to the CLI configuration file',
|
|
99
|
+
parse: (val)=>external_node_path_default().resolve(val)
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: '--output <string>',
|
|
103
|
+
description: 'Output directory for the bundle'
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
const bundle_remote_options = options;
|
|
107
|
+
exports["default"] = __webpack_exports__["default"];
|
|
108
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
109
|
+
"default"
|
|
110
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
111
|
+
Object.defineProperty(exports, '__esModule', {
|
|
112
|
+
value: true
|
|
113
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import node_path from "node:path";
|
|
3
|
+
const options = [
|
|
4
|
+
{
|
|
5
|
+
name: '--platform <string>',
|
|
6
|
+
description: 'Either "ios" or "android"',
|
|
7
|
+
default: 'ios'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: '--dev [boolean]',
|
|
11
|
+
description: 'If false, warnings are disabled and the bundle is minified',
|
|
12
|
+
parse: (val)=>'false' !== val,
|
|
13
|
+
default: true
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: '--minify [boolean]',
|
|
17
|
+
description: "Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.",
|
|
18
|
+
parse: (val)=>'false' !== val
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: '--bundle-encoding <string>',
|
|
22
|
+
description: 'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).',
|
|
23
|
+
default: 'utf8'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: '--max-workers <number>',
|
|
27
|
+
description: "Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: '--sourcemap-output <string>',
|
|
31
|
+
description: 'File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: '--sourcemap-sources-root <string>',
|
|
35
|
+
description: "Path to make sourcemap's sources entries relative to, ex. /root/dir"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: '--sourcemap-use-absolute-path',
|
|
39
|
+
description: 'Report SourceMapURL using its full path',
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: '--assets-dest <string>',
|
|
44
|
+
description: 'Directory name where to store assets referenced in the bundle'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: '--asset-catalog-dest [string]',
|
|
48
|
+
description: 'Path where to create an iOS Asset Catalog for images'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: '--reset-cache',
|
|
52
|
+
description: 'Removes cached files',
|
|
53
|
+
default: false
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: '--config <string>',
|
|
57
|
+
description: 'Path to the CLI configuration file',
|
|
58
|
+
parse: (val)=>node_path.resolve(val)
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: '--output <string>',
|
|
62
|
+
description: 'Output directory for the bundle'
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
const bundle_remote_options = options;
|
|
66
|
+
export default bundle_remote_options;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type BundleFederatedRemoteArgs = {
|
|
2
|
+
entryFile: string;
|
|
3
|
+
platform: string;
|
|
4
|
+
dev: boolean;
|
|
5
|
+
minify?: boolean;
|
|
6
|
+
bundleEncoding?: 'utf8' | 'utf16le' | 'ascii';
|
|
7
|
+
maxWorkers?: string;
|
|
8
|
+
sourcemapOutput?: string;
|
|
9
|
+
sourcemapSourcesRoot?: string;
|
|
10
|
+
sourcemapUseAbsolutePath?: boolean;
|
|
11
|
+
assetsDest?: string;
|
|
12
|
+
assetCatalogDest?: string;
|
|
13
|
+
resetCache?: boolean;
|
|
14
|
+
config?: string;
|
|
15
|
+
output?: string;
|
|
16
|
+
};
|