@module-federation/sdk 0.0.0-next-20240623084034 → 0.0.0-next-20240625025206

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/dist/index.cjs.js CHANGED
@@ -359,12 +359,17 @@ var generateShareFilename = function(pkgName, withExt) {
359
359
  };
360
360
  var getResourceUrl = function(module, sourceUrl) {
361
361
  if ('getPublicPath' in module) {
362
- var publicPath = new Function(module.getPublicPath)();
362
+ var publicPath;
363
+ if (!module.getPublicPath.startsWith('function')) {
364
+ publicPath = new Function(module.getPublicPath)();
365
+ } else {
366
+ publicPath = new Function('return ' + module.getPublicPath)()();
367
+ }
363
368
  return "".concat(publicPath).concat(sourceUrl);
364
369
  } else if ('publicPath' in module) {
365
370
  return "".concat(module.publicPath).concat(sourceUrl);
366
371
  } else {
367
- console.warn('Can not get resource url, if in debug mode, please ignore', module, sourceUrl);
372
+ console.warn('Cannot get resource URL. If in debug mode, please ignore.', module, sourceUrl);
368
373
  return '';
369
374
  }
370
375
  };
package/dist/index.esm.js CHANGED
@@ -355,12 +355,17 @@ var generateShareFilename = function(pkgName, withExt) {
355
355
  };
356
356
  var getResourceUrl = function(module, sourceUrl) {
357
357
  if ('getPublicPath' in module) {
358
- var publicPath = new Function(module.getPublicPath)();
358
+ var publicPath;
359
+ if (!module.getPublicPath.startsWith('function')) {
360
+ publicPath = new Function(module.getPublicPath)();
361
+ } else {
362
+ publicPath = new Function('return ' + module.getPublicPath)()();
363
+ }
359
364
  return "".concat(publicPath).concat(sourceUrl);
360
365
  } else if ('publicPath' in module) {
361
366
  return "".concat(module.publicPath).concat(sourceUrl);
362
367
  } else {
363
- console.warn('Can not get resource url, if in debug mode, please ignore', module, sourceUrl);
368
+ console.warn('Cannot get resource URL. If in debug mode, please ignore.', module, sourceUrl);
364
369
  return '';
365
370
  }
366
371
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.1.21",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [
@@ -91,6 +91,7 @@ export interface DtsHostOptions {
91
91
  deleteTypesFolder?: boolean;
92
92
  maxRetries?: number;
93
93
  consumeAPITypes?: boolean;
94
+ runtimePkgs?: string[];
94
95
  }
95
96
  export interface DtsRemoteOptions {
96
97
  tsConfigPath?: string;
@@ -157,6 +158,10 @@ export interface ModuleFederationPluginOptions {
157
158
  * Runtime plugin file paths or package name.
158
159
  */
159
160
  runtimePlugins?: string[];
161
+ /**
162
+ * Custom public path function
163
+ */
164
+ getPublicPath?: string;
160
165
  /**
161
166
  * Bundler runtime path
162
167
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240623084034",
3
+ "version": "0.0.0-next-20240625025206",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [