@module-federation/vite 1.2.3 → 1.2.5

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
@@ -757,6 +757,7 @@ var Manifest = function Manifest() {
757
757
  var remoteEntryFile;
758
758
  var publicPath;
759
759
  var _command;
760
+ var _originalConfigBase;
760
761
  var viteConfig;
761
762
  return [{
762
763
  name: 'module-federation-manifest',
@@ -776,7 +777,7 @@ var Manifest = function Manifest() {
776
777
  res.end(JSON.stringify(_extends({}, generateMFManifest({}), {
777
778
  id: name,
778
779
  name: name,
779
- metaData: _extends({
780
+ metaData: {
780
781
  name: name,
781
782
  type: 'app',
782
783
  buildInfo: {
@@ -798,12 +799,9 @@ var Manifest = function Manifest() {
798
799
  name: ''
799
800
  },
800
801
  globalName: name,
801
- pluginVersion: '0.2.5'
802
- }, !!getPublicPath ? {
803
- publicPath: getPublicPath
804
- } : {
802
+ pluginVersion: '0.2.5',
805
803
  publicPath: publicPath
806
- })
804
+ }
807
805
  })));
808
806
  } else {
809
807
  next();
@@ -818,6 +816,7 @@ var Manifest = function Manifest() {
818
816
  if (!_config.build) _config.build = {};
819
817
  if (!_config.build.manifest) _config.build.manifest = _config.build.manifest || !!manifestOptions;
820
818
  _command = command;
819
+ _originalConfigBase = _config.base;
821
820
  },
822
821
  configResolved: function configResolved(config) {
823
822
  root = config.root;
@@ -826,7 +825,7 @@ var Manifest = function Manifest() {
826
825
  if (_command === 'serve') {
827
826
  base = (config.server.origin || '') + config.base;
828
827
  }
829
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
828
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
830
829
  },
831
830
  generateBundle: function generateBundle(options, bundle) {
832
831
  try {
@@ -1038,7 +1037,7 @@ var Manifest = function Manifest() {
1038
1037
  globalName: name,
1039
1038
  pluginVersion: '0.2.5'
1040
1039
  }, !!getPublicPath ? {
1041
- publicPath: getPublicPath
1040
+ getPublicPath: getPublicPath
1042
1041
  } : {
1043
1042
  publicPath: publicPath
1044
1043
  }),
package/lib/index.esm.js CHANGED
@@ -733,6 +733,7 @@ var Manifest = function Manifest() {
733
733
  var remoteEntryFile;
734
734
  var publicPath;
735
735
  var _command;
736
+ var _originalConfigBase;
736
737
  var viteConfig;
737
738
  return [{
738
739
  name: 'module-federation-manifest',
@@ -752,7 +753,7 @@ var Manifest = function Manifest() {
752
753
  res.end(JSON.stringify(_extends({}, generateMFManifest({}), {
753
754
  id: name,
754
755
  name: name,
755
- metaData: _extends({
756
+ metaData: {
756
757
  name: name,
757
758
  type: 'app',
758
759
  buildInfo: {
@@ -774,12 +775,9 @@ var Manifest = function Manifest() {
774
775
  name: ''
775
776
  },
776
777
  globalName: name,
777
- pluginVersion: '0.2.5'
778
- }, !!getPublicPath ? {
779
- publicPath: getPublicPath
780
- } : {
778
+ pluginVersion: '0.2.5',
781
779
  publicPath: publicPath
782
- })
780
+ }
783
781
  })));
784
782
  } else {
785
783
  next();
@@ -794,6 +792,7 @@ var Manifest = function Manifest() {
794
792
  if (!_config.build) _config.build = {};
795
793
  if (!_config.build.manifest) _config.build.manifest = _config.build.manifest || !!manifestOptions;
796
794
  _command = command;
795
+ _originalConfigBase = _config.base;
797
796
  },
798
797
  configResolved: function configResolved(config) {
799
798
  root = config.root;
@@ -802,7 +801,7 @@ var Manifest = function Manifest() {
802
801
  if (_command === 'serve') {
803
802
  base = (config.server.origin || '') + config.base;
804
803
  }
805
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
804
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
806
805
  },
807
806
  generateBundle: function generateBundle(options, bundle) {
808
807
  try {
@@ -1014,7 +1013,7 @@ var Manifest = function Manifest() {
1014
1013
  globalName: name,
1015
1014
  pluginVersion: '0.2.5'
1016
1015
  }, !!getPublicPath ? {
1017
- publicPath: getPublicPath
1016
+ getPublicPath: getPublicPath
1018
1017
  } : {
1019
1018
  publicPath: publicPath
1020
1019
  }),
@@ -834,6 +834,7 @@ const Manifest = () => {
834
834
  let remoteEntryFile;
835
835
  let publicPath;
836
836
  let _command;
837
+ let _originalConfigBase;
837
838
  let viteConfig;
838
839
  return [{
839
840
  name: 'module-federation-manifest',
@@ -853,7 +854,7 @@ const Manifest = () => {
853
854
  res.end(JSON.stringify(_extends({}, generateMFManifest({}), {
854
855
  id: name,
855
856
  name: name,
856
- metaData: _extends({
857
+ metaData: {
857
858
  name: name,
858
859
  type: 'app',
859
860
  buildInfo: {
@@ -875,12 +876,9 @@ const Manifest = () => {
875
876
  name: ''
876
877
  },
877
878
  globalName: name,
878
- pluginVersion: '0.2.5'
879
- }, !!getPublicPath ? {
880
- publicPath: getPublicPath
881
- } : {
879
+ pluginVersion: '0.2.5',
882
880
  publicPath
883
- })
881
+ }
884
882
  })));
885
883
  } else {
886
884
  next();
@@ -896,6 +894,7 @@ const Manifest = () => {
896
894
  if (!config.build) config.build = {};
897
895
  if (!config.build.manifest) config.build.manifest = config.build.manifest || !!manifestOptions;
898
896
  _command = command;
897
+ _originalConfigBase = config.base;
899
898
  },
900
899
  configResolved(config) {
901
900
  root = config.root;
@@ -904,7 +903,7 @@ const Manifest = () => {
904
903
  if (_command === 'serve') {
905
904
  base = (config.server.origin || '') + config.base;
906
905
  }
907
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
906
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
908
907
  },
909
908
  async generateBundle(options, bundle) {
910
909
  if (!mfManifestName) return;
@@ -1088,7 +1087,7 @@ const Manifest = () => {
1088
1087
  globalName: name,
1089
1088
  pluginVersion: '0.2.5'
1090
1089
  }, !!getPublicPath ? {
1091
- publicPath: getPublicPath
1090
+ getPublicPath
1092
1091
  } : {
1093
1092
  publicPath
1094
1093
  }),
package/lib/index.umd.js CHANGED
@@ -755,6 +755,7 @@
755
755
  var remoteEntryFile;
756
756
  var publicPath;
757
757
  var _command;
758
+ var _originalConfigBase;
758
759
  var viteConfig;
759
760
  return [{
760
761
  name: 'module-federation-manifest',
@@ -774,7 +775,7 @@
774
775
  res.end(JSON.stringify(_extends({}, generateMFManifest({}), {
775
776
  id: name,
776
777
  name: name,
777
- metaData: _extends({
778
+ metaData: {
778
779
  name: name,
779
780
  type: 'app',
780
781
  buildInfo: {
@@ -796,12 +797,9 @@
796
797
  name: ''
797
798
  },
798
799
  globalName: name,
799
- pluginVersion: '0.2.5'
800
- }, !!getPublicPath ? {
801
- publicPath: getPublicPath
802
- } : {
800
+ pluginVersion: '0.2.5',
803
801
  publicPath: publicPath
804
- })
802
+ }
805
803
  })));
806
804
  } else {
807
805
  next();
@@ -816,6 +814,7 @@
816
814
  if (!_config.build) _config.build = {};
817
815
  if (!_config.build.manifest) _config.build.manifest = _config.build.manifest || !!manifestOptions;
818
816
  _command = command;
817
+ _originalConfigBase = _config.base;
819
818
  },
820
819
  configResolved: function configResolved(config) {
821
820
  root = config.root;
@@ -824,7 +823,7 @@
824
823
  if (_command === 'serve') {
825
824
  base = (config.server.origin || '') + config.base;
826
825
  }
827
- publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
826
+ publicPath = _originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
828
827
  },
829
828
  generateBundle: function generateBundle(options, bundle) {
830
829
  try {
@@ -1036,7 +1035,7 @@
1036
1035
  globalName: name,
1037
1036
  pluginVersion: '0.2.5'
1038
1037
  }, !!getPublicPath ? {
1039
- publicPath: getPublicPath
1038
+ getPublicPath: getPublicPath
1040
1039
  } : {
1041
1040
  publicPath: publicPath
1042
1041
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/vite",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "Vite plugin for Module Federation",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",