@module-federation/sdk 0.0.0-next-20250709075526 → 0.0.0-next-20250709090625

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.
Files changed (36) hide show
  1. package/dist/index.cjs +812 -0
  2. package/dist/index.js +656 -0
  3. package/dist/normalize-webpack-path.cjs +77 -0
  4. package/dist/{normalize-webpack-path.esm.js → normalize-webpack-path.js} +6 -15
  5. package/dist/{src/types → types}/plugins/ModuleFederationPlugin.d.ts +0 -4
  6. package/package.json +16 -22
  7. package/dist/index.cjs.cjs +0 -821
  8. package/dist/index.cjs.d.ts +0 -1
  9. package/dist/index.esm.d.ts +0 -1
  10. package/dist/index.esm.js +0 -771
  11. package/dist/normalize-webpack-path.cjs.cjs +0 -42
  12. package/dist/normalize-webpack-path.cjs.d.ts +0 -1
  13. package/dist/normalize-webpack-path.esm.d.ts +0 -1
  14. package/dist/polyfills.cjs.cjs +0 -14
  15. package/dist/polyfills.esm.js +0 -12
  16. /package/dist/{src/constant.d.ts → constant.d.ts} +0 -0
  17. /package/dist/{src/createModuleFederationConfig.d.ts → createModuleFederationConfig.d.ts} +0 -0
  18. /package/dist/{src/dom.d.ts → dom.d.ts} +0 -0
  19. /package/dist/{src/env.d.ts → env.d.ts} +0 -0
  20. /package/dist/{src/generateSnapshotFromManifest.d.ts → generateSnapshotFromManifest.d.ts} +0 -0
  21. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  22. /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
  23. /package/dist/{src/node.d.ts → node.d.ts} +0 -0
  24. /package/dist/{src/normalize-webpack-path.d.ts → normalize-webpack-path.d.ts} +0 -0
  25. /package/dist/{src/normalizeOptions.d.ts → normalizeOptions.d.ts} +0 -0
  26. /package/dist/{src/types → types}/common.d.ts +0 -0
  27. /package/dist/{src/types → types}/hooks.d.ts +0 -0
  28. /package/dist/{src/types → types}/index.d.ts +0 -0
  29. /package/dist/{src/types → types}/manifest.d.ts +0 -0
  30. /package/dist/{src/types → types}/plugins/ContainerPlugin.d.ts +0 -0
  31. /package/dist/{src/types → types}/plugins/ContainerReferencePlugin.d.ts +0 -0
  32. /package/dist/{src/types → types}/plugins/SharePlugin.d.ts +0 -0
  33. /package/dist/{src/types → types}/plugins/index.d.ts +0 -0
  34. /package/dist/{src/types → types}/snapshot.d.ts +0 -0
  35. /package/dist/{src/types → types}/stats.d.ts +0 -0
  36. /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ normalizeWebpackPath: ()=>normalizeWebpackPath,
37
+ getWebpackPath: ()=>getWebpackPath
38
+ });
39
+ const external_path_namespaceObject = require("path");
40
+ var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
41
+ function getWebpackPath(compiler, options = {
42
+ framework: 'other'
43
+ }) {
44
+ try {
45
+ compiler.webpack();
46
+ return '';
47
+ } catch (err) {
48
+ var _err_stack;
49
+ const trace = (null == (_err_stack = err.stack) ? void 0 : _err_stack.split('\n')) || [];
50
+ const webpackErrLocation = trace.find((item)=>item.includes('at webpack')) || '';
51
+ const webpackLocationWithDetail = webpackErrLocation.replace(/[^\(\)]+/, '').slice(1, -1);
52
+ const webpackPath = webpackLocationWithDetail.split(':').slice(0, -2).join(':');
53
+ if ((null == options ? void 0 : options.framework) === 'nextjs') {
54
+ if (webpackPath.endsWith('webpack.js')) return webpackPath.replace('webpack.js', 'index.js');
55
+ return '';
56
+ }
57
+ return require.resolve('webpack', {
58
+ paths: [
59
+ webpackPath
60
+ ]
61
+ });
62
+ }
63
+ }
64
+ const normalizeWebpackPath = (fullPath)=>{
65
+ if ('webpack' === fullPath) return process.env['FEDERATION_WEBPACK_PATH'] || fullPath;
66
+ if (process.env['FEDERATION_WEBPACK_PATH']) return external_path_default().resolve(process.env['FEDERATION_WEBPACK_PATH'], fullPath.replace('webpack', '../../'));
67
+ return fullPath;
68
+ };
69
+ exports.getWebpackPath = __webpack_exports__.getWebpackPath;
70
+ exports.normalizeWebpackPath = __webpack_exports__.normalizeWebpackPath;
71
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
72
+ "getWebpackPath",
73
+ "normalizeWebpackPath"
74
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
75
+ Object.defineProperty(exports, '__esModule', {
76
+ value: true
77
+ });
@@ -1,22 +1,18 @@
1
- import path from 'path';
2
-
1
+ import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
3
2
  function getWebpackPath(compiler, options = {
4
3
  framework: 'other'
5
4
  }) {
6
5
  try {
7
- // @ts-ignore just throw err
8
6
  compiler.webpack();
9
7
  return '';
10
8
  } catch (err) {
11
9
  var _err_stack;
12
- const trace = ((_err_stack = err.stack) == null ? void 0 : _err_stack.split('\n')) || [];
10
+ const trace = (null == (_err_stack = err.stack) ? void 0 : _err_stack.split('\n')) || [];
13
11
  const webpackErrLocation = trace.find((item)=>item.includes('at webpack')) || '';
14
12
  const webpackLocationWithDetail = webpackErrLocation.replace(/[^\(\)]+/, '').slice(1, -1);
15
13
  const webpackPath = webpackLocationWithDetail.split(':').slice(0, -2).join(':');
16
- if ((options == null ? void 0 : options.framework) === 'nextjs') {
17
- if (webpackPath.endsWith('webpack.js')) {
18
- return webpackPath.replace('webpack.js', 'index.js');
19
- }
14
+ if ((null == options ? void 0 : options.framework) === 'nextjs') {
15
+ if (webpackPath.endsWith('webpack.js')) return webpackPath.replace('webpack.js', 'index.js');
20
16
  return '';
21
17
  }
22
18
  return require.resolve('webpack', {
@@ -27,13 +23,8 @@ function getWebpackPath(compiler, options = {
27
23
  }
28
24
  }
29
25
  const normalizeWebpackPath = (fullPath)=>{
30
- if (fullPath === 'webpack') {
31
- return process.env['FEDERATION_WEBPACK_PATH'] || fullPath;
32
- }
33
- if (process.env['FEDERATION_WEBPACK_PATH']) {
34
- return path.resolve(process.env['FEDERATION_WEBPACK_PATH'], fullPath.replace('webpack', '../../'));
35
- }
26
+ if ('webpack' === fullPath) return process.env['FEDERATION_WEBPACK_PATH'] || fullPath;
27
+ if (process.env['FEDERATION_WEBPACK_PATH']) return __WEBPACK_EXTERNAL_MODULE_path__["default"].resolve(process.env['FEDERATION_WEBPACK_PATH'], fullPath.replace('webpack', '../../'));
36
28
  return fullPath;
37
29
  };
38
-
39
30
  export { getWebpackPath, normalizeWebpackPath };
@@ -198,10 +198,6 @@ export interface ModuleFederationPluginOptions {
198
198
  externalRuntime?: boolean;
199
199
  provideExternalRuntime?: boolean;
200
200
  asyncStartup?: boolean;
201
- /**
202
- * Enable reconstructed lookup for node_modules paths
203
- */
204
- nodeModulesReconstructedLookup?: boolean;
205
201
  /**
206
202
  * Options related to build optimizations.
207
203
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20250709075526",
3
+ "version": "0.0.0-next-20250709090625",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "A sdk for support module federation",
@@ -23,39 +23,33 @@
23
23
  },
24
24
  "author": "zhanghang <hanric.zhang@gmail.com>",
25
25
  "sideEffects": false,
26
- "main": "./dist/index.cjs.cjs",
27
- "module": "./dist/index.esm.js",
28
- "types": "./dist/index.cjs.d.ts",
26
+ "main": "./dist/index.cjs",
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
- "import": {
32
- "types": "./dist/index.esm.d.ts",
33
- "default": "./dist/index.esm.js"
34
- },
35
- "require": {
36
- "types": "./dist/index.cjs.d.ts",
37
- "default": "./dist/index.cjs.cjs"
38
- }
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js",
33
+ "require": "./dist/index.cjs"
39
34
  },
40
35
  "./normalize-webpack-path": {
41
- "import": {
42
- "types": "./dist/normalize-webpack-path.esm.d.ts",
43
- "default": "./dist/normalize-webpack-path.esm.js"
44
- },
45
- "require": {
46
- "types": "./dist/normalize-webpack-path.cjs.d.ts",
47
- "default": "./dist/normalize-webpack-path.cjs.cjs"
48
- }
36
+ "types": "./dist/normalize-webpack-path.d.ts",
37
+ "import": "./dist/normalize-webpack-path.js",
38
+ "require": "./dist/normalize-webpack-path.cjs"
49
39
  }
50
40
  },
51
41
  "typesVersions": {
52
42
  "*": {
53
43
  ".": [
54
- "./dist/index.cjs.d.ts"
44
+ "./dist/index.d.ts"
55
45
  ],
56
46
  "normalize-webpack-path": [
57
- "./dist/normalize-webpack-path.cjs.d.ts"
47
+ "./dist/normalize-webpack-path.d.ts"
58
48
  ]
59
49
  }
50
+ },
51
+ "scripts": {
52
+ "build": "rslib build",
53
+ "dev": "rslib build --watch"
60
54
  }
61
55
  }