@module-federation/vite 1.2.5 → 1.2.7
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/lib/index.cjs +8 -4
- package/lib/index.esm.js +8 -4
- package/lib/index.modern.js +8 -3
- package/lib/index.umd.js +8 -4
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -342,9 +342,12 @@ function searchPackageVersion(sharedName) {
|
|
|
342
342
|
var potentialPackageJsonDir = path__namespace.dirname(sharedPath);
|
|
343
343
|
var rootDir = path__namespace.parse(potentialPackageJsonDir).root;
|
|
344
344
|
while (path__namespace.parse(potentialPackageJsonDir).base !== 'node_modules' && potentialPackageJsonDir !== rootDir) {
|
|
345
|
-
var
|
|
346
|
-
if (fs__namespace.existsSync(
|
|
347
|
-
|
|
345
|
+
var potentialPackageJsonPath = path__namespace.join(potentialPackageJsonDir, 'package.json');
|
|
346
|
+
if (fs__namespace.existsSync(potentialPackageJsonPath)) {
|
|
347
|
+
var potentialPackageJson = require(potentialPackageJsonPath);
|
|
348
|
+
if (typeof potentialPackageJson == 'object' && potentialPackageJson !== null && typeof potentialPackageJson.version === 'string' && potentialPackageJson.name === sharedName) {
|
|
349
|
+
return potentialPackageJson.version;
|
|
350
|
+
}
|
|
348
351
|
}
|
|
349
352
|
potentialPackageJsonDir = path__namespace.dirname(potentialPackageJsonDir);
|
|
350
353
|
}
|
|
@@ -699,9 +702,10 @@ function generateLocalSharedImportMap() {
|
|
|
699
702
|
}).filter(function (x) {
|
|
700
703
|
return x !== null;
|
|
701
704
|
}).join(',') + "\n }\n const usedRemotes = [" + Object.keys(getUsedRemotesMap()).map(function (key) {
|
|
705
|
+
var _JSON$stringify;
|
|
702
706
|
var remote = options.remotes[key];
|
|
703
707
|
if (!remote) return null;
|
|
704
|
-
return "\n {\n entryGlobalName: " + JSON.stringify(remote.entryGlobalName) + ",\n name: " + JSON.stringify(remote.name) + ",\n type: " + JSON.stringify(remote.type) + ",\n entry: " + JSON.stringify(remote.entry) + ",\n }\n ";
|
|
708
|
+
return "\n {\n entryGlobalName: " + JSON.stringify(remote.entryGlobalName) + ",\n name: " + JSON.stringify(remote.name) + ",\n type: " + JSON.stringify(remote.type) + ",\n entry: " + JSON.stringify(remote.entry) + ",\n shareScope: " + ((_JSON$stringify = JSON.stringify(remote.shareScope)) != null ? _JSON$stringify : 'default') + ",\n }\n ";
|
|
705
709
|
}).filter(function (x) {
|
|
706
710
|
return x !== null;
|
|
707
711
|
}).join(',') + "\n ]\n export {\n usedShared,\n usedRemotes\n }\n ";
|
package/lib/index.esm.js
CHANGED
|
@@ -318,9 +318,12 @@ function searchPackageVersion(sharedName) {
|
|
|
318
318
|
var potentialPackageJsonDir = path.dirname(sharedPath);
|
|
319
319
|
var rootDir = path.parse(potentialPackageJsonDir).root;
|
|
320
320
|
while (path.parse(potentialPackageJsonDir).base !== 'node_modules' && potentialPackageJsonDir !== rootDir) {
|
|
321
|
-
var
|
|
322
|
-
if (fs.existsSync(
|
|
323
|
-
|
|
321
|
+
var potentialPackageJsonPath = path.join(potentialPackageJsonDir, 'package.json');
|
|
322
|
+
if (fs.existsSync(potentialPackageJsonPath)) {
|
|
323
|
+
var potentialPackageJson = require(potentialPackageJsonPath);
|
|
324
|
+
if (typeof potentialPackageJson == 'object' && potentialPackageJson !== null && typeof potentialPackageJson.version === 'string' && potentialPackageJson.name === sharedName) {
|
|
325
|
+
return potentialPackageJson.version;
|
|
326
|
+
}
|
|
324
327
|
}
|
|
325
328
|
potentialPackageJsonDir = path.dirname(potentialPackageJsonDir);
|
|
326
329
|
}
|
|
@@ -675,9 +678,10 @@ function generateLocalSharedImportMap() {
|
|
|
675
678
|
}).filter(function (x) {
|
|
676
679
|
return x !== null;
|
|
677
680
|
}).join(',') + "\n }\n const usedRemotes = [" + Object.keys(getUsedRemotesMap()).map(function (key) {
|
|
681
|
+
var _JSON$stringify;
|
|
678
682
|
var remote = options.remotes[key];
|
|
679
683
|
if (!remote) return null;
|
|
680
|
-
return "\n {\n entryGlobalName: " + JSON.stringify(remote.entryGlobalName) + ",\n name: " + JSON.stringify(remote.name) + ",\n type: " + JSON.stringify(remote.type) + ",\n entry: " + JSON.stringify(remote.entry) + ",\n }\n ";
|
|
684
|
+
return "\n {\n entryGlobalName: " + JSON.stringify(remote.entryGlobalName) + ",\n name: " + JSON.stringify(remote.name) + ",\n type: " + JSON.stringify(remote.type) + ",\n entry: " + JSON.stringify(remote.entry) + ",\n shareScope: " + ((_JSON$stringify = JSON.stringify(remote.shareScope)) != null ? _JSON$stringify : 'default') + ",\n }\n ";
|
|
681
685
|
}).filter(function (x) {
|
|
682
686
|
return x !== null;
|
|
683
687
|
}).join(',') + "\n ]\n export {\n usedShared,\n usedRemotes\n }\n ";
|
package/lib/index.modern.js
CHANGED
|
@@ -291,9 +291,12 @@ function searchPackageVersion(sharedName) {
|
|
|
291
291
|
let potentialPackageJsonDir = path.dirname(sharedPath);
|
|
292
292
|
const rootDir = path.parse(potentialPackageJsonDir).root;
|
|
293
293
|
while (path.parse(potentialPackageJsonDir).base !== 'node_modules' && potentialPackageJsonDir !== rootDir) {
|
|
294
|
-
const
|
|
295
|
-
if (fs.existsSync(
|
|
296
|
-
|
|
294
|
+
const potentialPackageJsonPath = path.join(potentialPackageJsonDir, 'package.json');
|
|
295
|
+
if (fs.existsSync(potentialPackageJsonPath)) {
|
|
296
|
+
const potentialPackageJson = require(potentialPackageJsonPath);
|
|
297
|
+
if (typeof potentialPackageJson == 'object' && potentialPackageJson !== null && typeof potentialPackageJson.version === 'string' && potentialPackageJson.name === sharedName) {
|
|
298
|
+
return potentialPackageJson.version;
|
|
299
|
+
}
|
|
297
300
|
}
|
|
298
301
|
potentialPackageJsonDir = path.dirname(potentialPackageJsonDir);
|
|
299
302
|
}
|
|
@@ -714,6 +717,7 @@ function generateLocalSharedImportMap() {
|
|
|
714
717
|
}).filter(x => x !== null).join(',')}
|
|
715
718
|
}
|
|
716
719
|
const usedRemotes = [${Object.keys(getUsedRemotesMap()).map(key => {
|
|
720
|
+
var _JSON$stringify;
|
|
717
721
|
const remote = options.remotes[key];
|
|
718
722
|
if (!remote) return null;
|
|
719
723
|
return `
|
|
@@ -722,6 +726,7 @@ function generateLocalSharedImportMap() {
|
|
|
722
726
|
name: ${JSON.stringify(remote.name)},
|
|
723
727
|
type: ${JSON.stringify(remote.type)},
|
|
724
728
|
entry: ${JSON.stringify(remote.entry)},
|
|
729
|
+
shareScope: ${(_JSON$stringify = JSON.stringify(remote.shareScope)) != null ? _JSON$stringify : 'default'},
|
|
725
730
|
}
|
|
726
731
|
`;
|
|
727
732
|
}).filter(x => x !== null).join(',')}
|
package/lib/index.umd.js
CHANGED
|
@@ -340,9 +340,12 @@
|
|
|
340
340
|
var potentialPackageJsonDir = path__namespace.dirname(sharedPath);
|
|
341
341
|
var rootDir = path__namespace.parse(potentialPackageJsonDir).root;
|
|
342
342
|
while (path__namespace.parse(potentialPackageJsonDir).base !== 'node_modules' && potentialPackageJsonDir !== rootDir) {
|
|
343
|
-
var
|
|
344
|
-
if (fs__namespace.existsSync(
|
|
345
|
-
|
|
343
|
+
var potentialPackageJsonPath = path__namespace.join(potentialPackageJsonDir, 'package.json');
|
|
344
|
+
if (fs__namespace.existsSync(potentialPackageJsonPath)) {
|
|
345
|
+
var potentialPackageJson = require(potentialPackageJsonPath);
|
|
346
|
+
if (typeof potentialPackageJson == 'object' && potentialPackageJson !== null && typeof potentialPackageJson.version === 'string' && potentialPackageJson.name === sharedName) {
|
|
347
|
+
return potentialPackageJson.version;
|
|
348
|
+
}
|
|
346
349
|
}
|
|
347
350
|
potentialPackageJsonDir = path__namespace.dirname(potentialPackageJsonDir);
|
|
348
351
|
}
|
|
@@ -697,9 +700,10 @@
|
|
|
697
700
|
}).filter(function (x) {
|
|
698
701
|
return x !== null;
|
|
699
702
|
}).join(',') + "\n }\n const usedRemotes = [" + Object.keys(getUsedRemotesMap()).map(function (key) {
|
|
703
|
+
var _JSON$stringify;
|
|
700
704
|
var remote = options.remotes[key];
|
|
701
705
|
if (!remote) return null;
|
|
702
|
-
return "\n {\n entryGlobalName: " + JSON.stringify(remote.entryGlobalName) + ",\n name: " + JSON.stringify(remote.name) + ",\n type: " + JSON.stringify(remote.type) + ",\n entry: " + JSON.stringify(remote.entry) + ",\n }\n ";
|
|
706
|
+
return "\n {\n entryGlobalName: " + JSON.stringify(remote.entryGlobalName) + ",\n name: " + JSON.stringify(remote.name) + ",\n type: " + JSON.stringify(remote.type) + ",\n entry: " + JSON.stringify(remote.entry) + ",\n shareScope: " + ((_JSON$stringify = JSON.stringify(remote.shareScope)) != null ? _JSON$stringify : 'default') + ",\n }\n ";
|
|
703
707
|
}).filter(function (x) {
|
|
704
708
|
return x !== null;
|
|
705
709
|
}).join(',') + "\n ]\n export {\n usedShared,\n usedRemotes\n }\n ";
|