@module-federation/enhanced 0.2.0-canary.2 → 0.2.0-canary.3
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/package.json +1 -1
- package/src/lib/container/ModuleFederationPlugin.js +3 -1
- package/src/lib/container/ModuleFederationPlugin.js.map +1 -1
- package/src/schemas/container/ModuleFederationPlugin.check.d.ts +3 -6
- package/src/schemas/container/ModuleFederationPlugin.check.js +2245 -0
- package/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -0
- package/src/schemas/container/ModuleFederationPlugin.d.ts +437 -0
- package/src/schemas/container/ModuleFederationPlugin.js +552 -0
- package/src/schemas/container/ModuleFederationPlugin.js.map +1 -0
package/package.json
CHANGED
|
@@ -16,13 +16,15 @@ const _SharePlugin = /*#__PURE__*/ _interop_require_default(require("../sharing/
|
|
|
16
16
|
const _createschemavalidation = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/create-schema-validation"));
|
|
17
17
|
const _ContainerPlugin = /*#__PURE__*/ _interop_require_default(require("./ContainerPlugin"));
|
|
18
18
|
const _ContainerReferencePlugin = /*#__PURE__*/ _interop_require_default(require("./ContainerReferencePlugin"));
|
|
19
|
+
const _ModuleFederationPlugincheck = /*#__PURE__*/ _interop_require_default(require("webpack/schemas/plugins/container/ModuleFederationPlugin.check.js"));
|
|
20
|
+
const _ModuleFederationPlugin = /*#__PURE__*/ _interop_require_default(require("../../schemas/container/ModuleFederationPlugin"));
|
|
19
21
|
function _interop_require_default(obj) {
|
|
20
22
|
return obj && obj.__esModule ? obj : {
|
|
21
23
|
default: obj
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
const validate = (0, _createschemavalidation.default)(//eslint-disable-next-line
|
|
25
|
-
|
|
27
|
+
_ModuleFederationPlugincheck.default, ()=>_ModuleFederationPlugin.default, {
|
|
26
28
|
name: 'Module Federation Plugin',
|
|
27
29
|
baseDataPath: 'options'
|
|
28
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ModuleFederationPlugin.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport type Compiler from 'webpack/lib/Compiler';\nimport isValidExternalsType from 'webpack/schemas/plugins/container/ExternalsType.check.js';\nimport type { ModuleFederationPluginOptions } from './ModuleFederationPluginTypes';\nimport SharePlugin from '../sharing/SharePlugin';\nimport createSchemaValidation from 'webpack/lib/util/create-schema-validation';\nimport ContainerPlugin from './ContainerPlugin';\nimport ContainerReferencePlugin from './ContainerReferencePlugin';\n\nconst validate = createSchemaValidation(\n //eslint-disable-next-line\n
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ModuleFederationPlugin.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport type Compiler from 'webpack/lib/Compiler';\nimport isValidExternalsType from 'webpack/schemas/plugins/container/ExternalsType.check.js';\nimport type { ModuleFederationPluginOptions } from './ModuleFederationPluginTypes';\nimport SharePlugin from '../sharing/SharePlugin';\nimport createSchemaValidation from 'webpack/lib/util/create-schema-validation';\nimport ContainerPlugin from './ContainerPlugin';\nimport ContainerReferencePlugin from './ContainerReferencePlugin';\nimport checkOptions from 'webpack/schemas/plugins/container/ModuleFederationPlugin.check.js';\nimport schema from '../../schemas/container/ModuleFederationPlugin';\n\nconst validate = createSchemaValidation(\n //eslint-disable-next-line\n checkOptions,\n () => schema,\n {\n name: 'Module Federation Plugin',\n baseDataPath: 'options',\n },\n);\n\nclass ModuleFederationPlugin {\n private _options: ModuleFederationPluginOptions;\n /**\n * @param {ModuleFederationPluginOptions} options options\n */\n constructor(options: ModuleFederationPluginOptions) {\n validate(options);\n\n this._options = options;\n }\n\n /**\n * Apply the plugin\n * @param {Compiler} compiler the compiler instance\n * @returns {void}\n */\n apply(compiler: Compiler): void {\n const { _options: options } = this;\n const library = options.library || { type: 'var', name: options.name };\n const remoteType =\n options.remoteType ||\n (options.library && isValidExternalsType(options.library.type)\n ? options.library.type\n : 'script');\n if (\n library &&\n !compiler.options.output.enabledLibraryTypes?.includes(library.type)\n ) {\n compiler.options.output.enabledLibraryTypes?.push(library.type);\n }\n compiler.hooks.afterPlugins.tap('ModuleFederationPlugin', () => {\n if (\n options.exposes &&\n (Array.isArray(options.exposes)\n ? options.exposes.length > 0\n : Object.keys(options.exposes).length > 0)\n ) {\n new ContainerPlugin({\n //@ts-ignore\n name: options.name,\n library,\n filename: options.filename,\n runtime: options.runtime,\n shareScope: options.shareScope,\n exposes: options.exposes,\n }).apply(compiler);\n }\n if (\n options.remotes &&\n (Array.isArray(options.remotes)\n ? options.remotes.length > 0\n : Object.keys(options.remotes).length > 0)\n ) {\n new ContainerReferencePlugin({\n //@ts-ignore\n remoteType,\n shareScope: options.shareScope,\n remotes: options.remotes,\n }).apply(compiler);\n }\n if (options.shared) {\n new SharePlugin({\n shared: options.shared,\n shareScope: options.shareScope,\n }).apply(compiler);\n }\n });\n }\n}\n\nexport default ModuleFederationPlugin;\n"],"names":["validate","createSchemaValidation","checkOptions","schema","name","baseDataPath","ModuleFederationPlugin","apply","compiler","_options","options","library","type","remoteType","isValidExternalsType","output","enabledLibraryTypes","includes","push","hooks","afterPlugins","tap","exposes","Array","isArray","length","Object","keys","ContainerPlugin","filename","runtime","shareScope","remotes","ContainerReferencePlugin","shared","SharePlugin","constructor"],"mappings":"AAAA;;;AAGA,GAEA;;;;+BA4FA;;;eAAA;;;2EAzFiC;oEAET;+EACW;wEACP;iFACS;oFACZ;+EACN;;;;;;AAEnB,MAAMA,WAAWC,IAAAA,+BAAsB,EACrC,0BAA0B;AAC1BC,oCAAY,EACZ,IAAMC,+BAAM,EACZ;IACEC,MAAM;IACNC,cAAc;AAChB;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B,QAAQsB,OAAO,EAAEP,MAAM,GAAG,CAAA,GAC1C;gBACA,IAAIQ,iCAAwB,CAAC;oBAC3B,YAAY;oBACZpB;oBACAkB,YAAYrB,QAAQqB,UAAU;oBAC9BC,SAAStB,QAAQsB,OAAO;gBAC1B,GAAGzB,KAAK,CAACC;YACX;YACA,IAAIE,QAAQwB,MAAM,EAAE;gBAClB,IAAIC,oBAAW,CAAC;oBACdD,QAAQxB,QAAQwB,MAAM;oBACtBH,YAAYrB,QAAQqB,UAAU;gBAChC,GAAGxB,KAAK,CAACC;YACX;QACF;IACF;IAjEA;;GAEC,GACD4B,YAAY1B,OAAsC,CAAE;QAClDV,SAASU;QAET,IAAI,CAACD,QAAQ,GAAGC;IAClB;AA2DF;MAEA,WAAeJ"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
declare function D(n: any, { instancePath: s, parentData: a, parentDataProperty: i, rootData: l, }?: {
|
|
1
|
+
declare function D(n: any, { instancePath: s, parentData, parentDataProperty, rootData: l, }?: {
|
|
3
2
|
instancePath?: string | undefined;
|
|
4
3
|
parentData: any;
|
|
5
4
|
parentDataProperty: any;
|
|
6
5
|
rootData?: any;
|
|
7
|
-
}):
|
|
8
|
-
|
|
9
|
-
export { D as default };
|
|
10
|
-
}
|
|
6
|
+
}): any;
|
|
7
|
+
export default D;
|