@gravity-ui/app-builder 0.31.0 → 0.31.1
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.
|
@@ -382,19 +382,20 @@ function configureEntry({ config, entriesDirectory }) {
|
|
|
382
382
|
let entryFiles = fs.readdirSync(entriesDirectory).filter((file) => /\.[jt]sx?$/.test(file));
|
|
383
383
|
let result = {};
|
|
384
384
|
if (config.moduleFederation) {
|
|
385
|
-
const { name, remotes } = config.moduleFederation;
|
|
385
|
+
const { name, remotes, originalRemotes } = config.moduleFederation;
|
|
386
386
|
const entryFile = entryFiles.find((item) => path.parse(item).name === name);
|
|
387
387
|
if (!entryFile) {
|
|
388
388
|
throw new Error(`Entry "${name}" not found`);
|
|
389
389
|
}
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
const remoteNames = remotes || (originalRemotes && Object.keys(originalRemotes)) || undefined;
|
|
391
|
+
// If remotes are empty, it means that we are a remote
|
|
392
|
+
if (!remoteNames || remoteNames.length === 0) {
|
|
392
393
|
return path.resolve(entriesDirectory, entryFile);
|
|
393
394
|
}
|
|
394
395
|
entryFiles = entryFiles.filter((file) => {
|
|
395
396
|
const fileName = path.parse(file).name;
|
|
396
397
|
return (!isModuleFederationEntry(name, fileName) &&
|
|
397
|
-
|
|
398
|
+
remoteNames.every((remote) => !isModuleFederationEntry(remote, fileName)));
|
|
398
399
|
});
|
|
399
400
|
result = {
|
|
400
401
|
main: createEntryArray(path.resolve(entriesDirectory, entryFile)),
|