@module-federation/vite 1.2.4 → 1.2.6

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 CHANGED
@@ -699,9 +699,10 @@ function generateLocalSharedImportMap() {
699
699
  }).filter(function (x) {
700
700
  return x !== null;
701
701
  }).join(',') + "\n }\n const usedRemotes = [" + Object.keys(getUsedRemotesMap()).map(function (key) {
702
+ var _JSON$stringify;
702
703
  var remote = options.remotes[key];
703
704
  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 ";
705
+ 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
706
  }).filter(function (x) {
706
707
  return x !== null;
707
708
  }).join(',') + "\n ]\n export {\n usedShared,\n usedRemotes\n }\n ";
@@ -757,6 +758,7 @@ var Manifest = function Manifest() {
757
758
  var remoteEntryFile;
758
759
  var publicPath;
759
760
  var _command;
761
+ var _originalConfigBase;
760
762
  var viteConfig;
761
763
  return [{
762
764
  name: 'module-federation-manifest',
@@ -815,6 +817,7 @@ var Manifest = function Manifest() {
815
817
  if (!_config.build) _config.build = {};
816
818
  if (!_config.build.manifest) _config.build.manifest = _config.build.manifest || !!manifestOptions;
817
819
  _command = command;
820
+ _originalConfigBase = _config.base;
818
821
  },
819
822
  configResolved: function configResolved(config) {
820
823
  root = config.root;
@@ -823,7 +826,7 @@ var Manifest = function Manifest() {
823
826
  if (_command === 'serve') {
824
827
  base = (config.server.origin || '') + config.base;
825
828
  }
826
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
829
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
827
830
  },
828
831
  generateBundle: function generateBundle(options, bundle) {
829
832
  try {
package/lib/index.esm.js CHANGED
@@ -675,9 +675,10 @@ function generateLocalSharedImportMap() {
675
675
  }).filter(function (x) {
676
676
  return x !== null;
677
677
  }).join(',') + "\n }\n const usedRemotes = [" + Object.keys(getUsedRemotesMap()).map(function (key) {
678
+ var _JSON$stringify;
678
679
  var remote = options.remotes[key];
679
680
  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 ";
681
+ 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
682
  }).filter(function (x) {
682
683
  return x !== null;
683
684
  }).join(',') + "\n ]\n export {\n usedShared,\n usedRemotes\n }\n ";
@@ -733,6 +734,7 @@ var Manifest = function Manifest() {
733
734
  var remoteEntryFile;
734
735
  var publicPath;
735
736
  var _command;
737
+ var _originalConfigBase;
736
738
  var viteConfig;
737
739
  return [{
738
740
  name: 'module-federation-manifest',
@@ -791,6 +793,7 @@ var Manifest = function Manifest() {
791
793
  if (!_config.build) _config.build = {};
792
794
  if (!_config.build.manifest) _config.build.manifest = _config.build.manifest || !!manifestOptions;
793
795
  _command = command;
796
+ _originalConfigBase = _config.base;
794
797
  },
795
798
  configResolved: function configResolved(config) {
796
799
  root = config.root;
@@ -799,7 +802,7 @@ var Manifest = function Manifest() {
799
802
  if (_command === 'serve') {
800
803
  base = (config.server.origin || '') + config.base;
801
804
  }
802
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
805
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
803
806
  },
804
807
  generateBundle: function generateBundle(options, bundle) {
805
808
  try {
@@ -714,6 +714,7 @@ function generateLocalSharedImportMap() {
714
714
  }).filter(x => x !== null).join(',')}
715
715
  }
716
716
  const usedRemotes = [${Object.keys(getUsedRemotesMap()).map(key => {
717
+ var _JSON$stringify;
717
718
  const remote = options.remotes[key];
718
719
  if (!remote) return null;
719
720
  return `
@@ -722,6 +723,7 @@ function generateLocalSharedImportMap() {
722
723
  name: ${JSON.stringify(remote.name)},
723
724
  type: ${JSON.stringify(remote.type)},
724
725
  entry: ${JSON.stringify(remote.entry)},
726
+ shareScope: ${(_JSON$stringify = JSON.stringify(remote.shareScope)) != null ? _JSON$stringify : 'default'},
725
727
  }
726
728
  `;
727
729
  }).filter(x => x !== null).join(',')}
@@ -834,6 +836,7 @@ const Manifest = () => {
834
836
  let remoteEntryFile;
835
837
  let publicPath;
836
838
  let _command;
839
+ let _originalConfigBase;
837
840
  let viteConfig;
838
841
  return [{
839
842
  name: 'module-federation-manifest',
@@ -893,6 +896,7 @@ const Manifest = () => {
893
896
  if (!config.build) config.build = {};
894
897
  if (!config.build.manifest) config.build.manifest = config.build.manifest || !!manifestOptions;
895
898
  _command = command;
899
+ _originalConfigBase = config.base;
896
900
  },
897
901
  configResolved(config) {
898
902
  root = config.root;
@@ -901,7 +905,7 @@ const Manifest = () => {
901
905
  if (_command === 'serve') {
902
906
  base = (config.server.origin || '') + config.base;
903
907
  }
904
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
908
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
905
909
  },
906
910
  async generateBundle(options, bundle) {
907
911
  if (!mfManifestName) return;
package/lib/index.umd.js CHANGED
@@ -697,9 +697,10 @@
697
697
  }).filter(function (x) {
698
698
  return x !== null;
699
699
  }).join(',') + "\n }\n const usedRemotes = [" + Object.keys(getUsedRemotesMap()).map(function (key) {
700
+ var _JSON$stringify;
700
701
  var remote = options.remotes[key];
701
702
  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 ";
703
+ 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
704
  }).filter(function (x) {
704
705
  return x !== null;
705
706
  }).join(',') + "\n ]\n export {\n usedShared,\n usedRemotes\n }\n ";
@@ -755,6 +756,7 @@
755
756
  var remoteEntryFile;
756
757
  var publicPath;
757
758
  var _command;
759
+ var _originalConfigBase;
758
760
  var viteConfig;
759
761
  return [{
760
762
  name: 'module-federation-manifest',
@@ -813,6 +815,7 @@
813
815
  if (!_config.build) _config.build = {};
814
816
  if (!_config.build.manifest) _config.build.manifest = _config.build.manifest || !!manifestOptions;
815
817
  _command = command;
818
+ _originalConfigBase = _config.base;
816
819
  },
817
820
  configResolved: function configResolved(config) {
818
821
  root = config.root;
@@ -821,7 +824,7 @@
821
824
  if (_command === 'serve') {
822
825
  base = (config.server.origin || '') + config.base;
823
826
  }
824
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
827
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
825
828
  },
826
829
  generateBundle: function generateBundle(options, bundle) {
827
830
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/vite",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Vite plugin for Module Federation",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",