To run:
yarn
yarn build
Note that in dist/remoteEntry.js
, we have a register()
call for react
but not module-federation-share-self
.
/******/ /* webpack/runtime/sharing */
/******/ (() => {
/******/ __webpack_require__.S = {};
/******/ var initPromises = {};
/******/ __webpack_require__.I = (name) => {
/******/ // only runs once
/******/ if(initPromises[name]) return initPromises[name];
/******/ // handling circular init calls
/******/ initPromises[name] = 1;
/******/ // creates a new share scope if needed
/******/ if(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};
/******/ // runs all init snippets from all modules reachable
/******/ var scope = __webpack_require__.S[name];
/******/ var warn = (msg) => typeof console !== "undefined" && console.warn && console.warn(msg);;
/******/ var uniqueName = "module-federation-share-self";
/******/ var register = (name, version, factory) => {
/******/ var versions = scope[name] = scope[name] || {};
/******/ var activeVersion = versions[version];
/******/ if(!activeVersion || !activeVersion.loaded && uniqueName > activeVersion.from) versions[version] = { get: factory, from: uniqueName };
/******/ };
/******/ var initExternal = (id) => {
/******/ var handleError = (err) => warn("Initialization of sharing external failed: " + err);
/******/ try {
/******/ var module = __webpack_require__(id);
/******/ if(!module) return;
/******/ var initFn = (module) => module && module.init && module.init(__webpack_require__.S[name])
/******/ if(module.then) return promises.push(module.then(initFn, handleError));
/******/ var initResult = initFn(module);
/******/ if(initResult && initResult.then) return promises.push(initResult.catch(handleError));
/******/ } catch(err) { handleError(err); }
/******/ }
/******/ var promises = [];
/******/ switch(name) {
/******/ case "default": {
/******/ register("react", "16.13.1", () => __webpack_require__.e("vendors-node_modules_react_index_js").then(() => () => __webpack_require__(/*! ./node_modules/react/index.js */ "./node_modules/react/index.js")));
/******/ }
/******/ break;
/******/ }
/******/ return promises.length && (initPromises[name] = Promise.all(promises).then(() => initPromises[name] = 1));
/******/ };
/******/ })();