@empjs/share 3.13.9-beta.1 → 4.0.0-alpha.1
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/README.md +202 -62
- package/dist/171.js +2 -0
- package/dist/171.js.map +1 -0
- package/dist/227.js +2 -0
- package/dist/227.js.map +1 -0
- package/dist/607.js +2 -0
- package/dist/607.js.map +1 -0
- package/dist/68.js +2 -0
- package/dist/68.js.map +1 -0
- package/dist/adapter/index.d.ts +1 -0
- package/dist/{adapter.d.cts → adapter/react.d.ts} +3 -8
- package/dist/adapter/vue.d.ts +1 -0
- package/dist/adapter.d.ts +1 -14
- package/dist/adapter.js +2 -1
- package/dist/adapter.js.map +1 -1
- package/dist/adapterVue.d.ts +1 -0
- package/dist/adapterVue.js +1 -0
- package/dist/forceRemote.d.ts +2 -19
- package/dist/forceRemote.js +2 -1
- package/dist/forceRemote.js.map +1 -1
- package/dist/framework/react/config.d.ts +1 -0
- package/dist/framework/react/index.d.ts +3 -0
- package/dist/framework/react/shared.d.ts +2 -0
- package/dist/framework/vue/config.d.ts +1 -0
- package/dist/framework/vue/index.d.ts +3 -0
- package/dist/framework/vue/shared.d.ts +2 -0
- package/dist/helper/config.d.ts +3 -0
- package/dist/helper/index.d.ts +6 -0
- package/dist/helper/moduleFederation.d.ts +6 -0
- package/dist/helper/resolvePackageExport.d.ts +1 -0
- package/dist/helper/rspack.d.ts +1 -0
- package/dist/index.d.ts +3 -9
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/library/full.d.ts +7 -0
- package/dist/library/sdk.d.ts +2 -0
- package/dist/library/sdkPolyfill.d.ts +3 -0
- package/dist/library/wSdk.d.ts +2 -0
- package/dist/mfRuntime.d.ts +1 -1
- package/dist/mfRuntime.js +1 -1
- package/dist/plugins/rspack/index.d.ts +11 -0
- package/dist/plugins/rspack/plugin.d.ts +7 -0
- package/dist/plugins/rspack/runtimePlugin/forceRemote.d.ts +13 -0
- package/dist/plugins/rspack/runtimePlugin/registerRemotes.d.ts +3 -0
- package/dist/plugins/rspack/share.d.ts +30 -0
- package/dist/{types-BGnQUQ0O.d.cts → plugins/rspack/types.d.ts} +14 -17
- package/dist/plugins/rspack/utils.d.ts +2 -0
- package/dist/react.d.ts +1 -9
- package/dist/react.js +2 -1
- package/dist/react.js.map +1 -1
- package/dist/rspack.d.ts +2 -15
- package/dist/rspack.js +2 -1
- package/dist/rspack.js.map +1 -1
- package/dist/{runtime.d.cts → runtime/index.d.ts} +4 -7
- package/dist/runtime/index.pre.version.d.ts +22 -0
- package/dist/runtime/plugins.d.ts +2 -0
- package/dist/runtime/sdk-prev.d.ts +30 -0
- package/dist/runtime/sdk.d.ts +31 -0
- package/dist/runtime.d.ts +2 -23
- package/dist/runtime.js +2 -1
- package/dist/runtime.js.map +1 -1
- package/dist/sdk.d.ts +1 -34
- package/dist/sdk.js +2 -1
- package/dist/sdk.js.map +1 -1
- package/dist/types/index.d.ts +26 -0
- package/dist/vue.d.ts +1 -9
- package/dist/vue.js +2 -1
- package/dist/vue.js.map +1 -1
- package/output/adapter/index.d.ts +1 -0
- package/output/adapter/react.d.ts +9 -0
- package/output/adapter/vue.d.ts +1 -0
- package/output/framework/react/config.d.ts +1 -0
- package/output/framework/react/index.d.ts +3 -0
- package/output/framework/react/shared.d.ts +2 -0
- package/output/framework/vue/config.d.ts +1 -0
- package/output/framework/vue/index.d.ts +3 -0
- package/output/framework/vue/shared.d.ts +2 -0
- package/output/helper/config.d.ts +3 -0
- package/output/helper/index.d.ts +6 -0
- package/output/helper/moduleFederation.d.ts +6 -0
- package/output/helper/resolvePackageExport.d.ts +1 -0
- package/output/helper/rspack.d.ts +1 -0
- package/output/index.d.ts +3 -0
- package/output/library/full.d.ts +7 -0
- package/output/library/sdk.d.ts +2 -0
- package/output/library/sdkPolyfill.d.ts +3 -0
- package/output/library/wSdk.d.ts +2 -0
- package/output/plugins/rspack/index.d.ts +11 -0
- package/output/plugins/rspack/plugin.d.ts +7 -0
- package/output/plugins/rspack/runtimePlugin/forceRemote.d.ts +13 -0
- package/output/plugins/rspack/runtimePlugin/registerRemotes.d.ts +3 -0
- package/output/plugins/rspack/share.d.ts +30 -0
- package/{dist/types-BGnQUQ0O.d.ts → output/plugins/rspack/types.d.ts} +14 -17
- package/output/plugins/rspack/utils.d.ts +2 -0
- package/output/runtime/index.d.ts +20 -0
- package/output/runtime/index.pre.version.d.ts +22 -0
- package/output/runtime/mfRuntime.d.ts +1 -0
- package/output/runtime/plugins.d.ts +2 -0
- package/output/runtime/sdk-prev.d.ts +30 -0
- package/output/runtime/sdk.d.ts +31 -0
- package/output/sdk.d.ts +1 -0
- package/output/sdk.js +5 -1
- package/output/types/index.d.ts +26 -0
- package/package.json +42 -91
- package/dist/adapter.cjs +0 -1
- package/dist/adapter.cjs.map +0 -1
- package/dist/forceRemote.cjs +0 -1
- package/dist/forceRemote.cjs.map +0 -1
- package/dist/forceRemote.d.cts +0 -19
- package/dist/index-DaSrQPN9.d.cts +0 -21
- package/dist/index-DaSrQPN9.d.ts +0 -21
- package/dist/index.cjs +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -9
- package/dist/mfRuntime.cjs +0 -1
- package/dist/mfRuntime.cjs.map +0 -1
- package/dist/mfRuntime.js.map +0 -1
- package/dist/react.cjs +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.d.cts +0 -9
- package/dist/rspack.cjs +0 -1
- package/dist/rspack.cjs.map +0 -1
- package/dist/rspack.d.cts +0 -15
- package/dist/runtime.cjs +0 -1
- package/dist/runtime.cjs.map +0 -1
- package/dist/sdk.cjs +0 -1
- package/dist/sdk.cjs.map +0 -1
- package/dist/sdk.d.cts +0 -34
- package/dist/vue.cjs +0 -1
- package/dist/vue.cjs.map +0 -1
- package/dist/vue.d.cts +0 -9
- /package/dist/{mfRuntime.d.cts → runtime/mfRuntime.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t,r,n,i,a,o){try{var u=e[a](o);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,i)}}function n(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var o=e.apply(t,n);function u(e){r(o,i,a,u,s,"next",e)}function s(e){r(o,i,a,u,s,"throw",e)}u(undefined)})}}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function o(e,t,r){if(t)a(e.prototype,t);if(r)a(e,r);return e}function u(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var i=true;var a=false;var o,u;try{for(r=r.call(e);!(i=(o=r.next()).done);i=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,r){return t(e)||u(e,r)||c(e,r)||s()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function c(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function m(e,t){var r,n,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=u(0),o["throw"]=u(1),o["return"]=u(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(a=0)),a)try{if(r=1,n&&(i=u[0]&2?n["return"]:u[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;if(n=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(u[0]===6&&a.label<i[1]){a.label=i[1];i=u;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(u);break}if(i[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var h=Object.defineProperty;var p=function(e,t,r){return t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var y=function(e){return(typeof require==="undefined"?"undefined":f(require))<"u"?require:(typeof Proxy==="undefined"?"undefined":f(Proxy))<"u"?new Proxy(e,{get:function(e,t){return((typeof require==="undefined"?"undefined":f(require))<"u"?require:e)[t]}}):e}(function(e){if((typeof require==="undefined"?"undefined":f(require))<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var b=function(e,t,r){return p(e,(typeof t==="undefined"?"undefined":f(t))!="symbol"?t+"":t,r)};var d=function(e){return"data:text/javascript,".concat(e)};function v(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var i=true,a=false,o=undefined;try{for(var u=r[Symbol.iterator](),s;!(i=(s=u.next()).done);i=true){var l=s.value;for(var f in l){var c=l[f],m=e[f];if(Object(c)==c&&Object(m)===m){e[f]=v(m,c);continue}e[f]=l[f]}}}catch(e){a=true;o=e}finally{try{if(!i&&u.return!=null){u.return()}}finally{if(a){throw o}}}return e}var g=!1,k=g?console.log.bind(console,"[EMP Share]"):function(){};var j="EMP_SHARE_RUNTIME",w="EMPShareGlobalVal",R="EMP_FORCE_REMOTES";import{ModuleFederationPlugin as x}from"@empjs/module-federation-rspack";var E=function(e){var t=["import '".concat(e,"'")].join("\n");return d(t)},O=/*#__PURE__*/function(){"use strict";function e(t){i(this,e);b(this,"options");this.options=t}o(e,[{key:"apply",value:function e(e){var t=e.webpack,r=E("@empjs/share/library");new t.EntryPlugin(e.context,r,{name:void 0}).apply(e)}}]);return e}();var S=function(e,t){Object.keys(t).length>0&&e.injectTags([{innerHTML:"window.".concat(R," = ").concat(JSON.stringify(t),";"),tagName:"script",pos:"head"}],"EMP_FORCE_REMOTES")};function M(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"runtime";return typeof e=="string"?r==="runtime"?"".concat(e,"/runtime").concat(t==="development"?".development":"",".umd.js"):"".concat(e,"/").concat(r,".").concat(t,".umd.js"):(typeof e==="undefined"?"undefined":f(e))=="object"?t==="development"?e.dev:e.prod:""}var L=/^([0-9a-zA-Z_\s]+)@(.*)/,N=/*#__PURE__*/function(){"use strict";function e(t,r){i(this,e);b(this,"op");b(this,"store");b(this,"injectHtml",[]);b(this,"externalsLib",[]);b(this,"fk");b(this,"rt");this.op=t||{},this.store=r}o(e,[{key:"setup",value:function e(){this.resetRuntime(),this.resetFramework(),this.setMfName(),this.setMF(),this.injectGlobalVal(),this.injectFramework(),this.setShareLib(),this.setRuntimeLib(),this.injectToHtml(),this.setExternal()}},{key:"injectToHtml",value:function e(){var e=this,t=e.store,r=e.injectHtml;r.length>0&&t.injectTags(r,"EMPShare")}},{key:"injectFramework",value:function e(){if(this.fk&&this.fk.libs.length>0)return this.injectFkLibs(this.fk.libs);if(!this.op.empRuntime||!this.fk.lib)return;var e=this,t=e.store,r=e.injectHtml;if(this.fk.lib){var n=M(this.fk.lib,t.mode,this.fk.entry);r.push({attributes:{src:n},tagName:"script"})}}},{key:"injectFkLibs",value:function e(e){var t=this;e.map(function(e){if(e.endsWith(".css"))return t.injectHtml.push({attributes:{href:e,rel:"stylesheet"},tagName:"link"});t.injectHtml.push({attributes:{src:e},tagName:"script"})})}},{key:"injectGlobalVal",value:function e(){if(!this.op.empRuntime)return;var e=this.op,t=e.empRuntime,r=this,n=r.injectHtml,i=this.fk.global||(t.shareLib?"window":"");if(!(t.injectGlobalValToHtml===!1||!this.rt.lib)){var a={frameworkLib:i,runtimeLib:this.rt.global};this.fk.name&&this.fk.name!=="none"&&(a.framework=this.fk.name),n.push({tagName:"script",innerHTML:"window.".concat(w,"=").concat(JSON.stringify(a))})}}},{key:"resetFramework",value:function e(){if(!this.op.empRuntime)return;var e=this.op.empRuntime,t=e.framework,r=e.frameworkGlobal,n=e.frameworkLib;this.fk={name:"none",version:0,entry:"",global:r||"",lib:n||"",libs:[]},typeof t=="string"?this.fk.name=t:(typeof t==="undefined"?"undefined":f(t))=="object"&&Object.keys(t).length>0&&(t.entry=t.entry?t.entry:t.name,this.fk=v(this.fk,t))}},{key:"resetRuntime",value:function e(){var e;var t=this.op,r=t.empRuntime;if(!r)return;var n=r.runtimeGlobal||j,i=r.runtimeLib?r.runtimeLib:((e=r.runtime)===null||e===void 0?void 0:e.lib)?r.runtime.lib:"";this.rt={lib:i,global:n}}},{key:"setExternal",value:function e(){var e=this;if(!this.op.empRuntime)return;var t=this,r=t.store,n=t.externalsLib,i=this.op,a=i.empRuntime,o=a.shareLib,u=this.rt.lib?{"@module-federation/runtime":"MFRuntime","@module-federation/sdk":"MFSDK"}:{},s={};var f=true,c=false,m=undefined;try{for(var h=Object.entries(u)[Symbol.iterator](),p;!(f=(p=h.next()).done);f=true){var y=l(p.value,2),b=y[0],d=y[1];s[b]="".concat(this.rt.global,".").concat(d)}}catch(e){c=true;m=e}finally{try{if(!f&&h.return!=null){h.return()}}finally{if(c){throw m}}}if(this.fk.name==="react"&&!o&&this.fk.global){var v=this.fk.version,g={react:"React","react-dom":"ReactDOM"};this.fk.entry==="reactRouter"&&(g["react-router-dom"]="ReactRouterDOM");var k=true,j=false,w=undefined;try{for(var R=Object.entries(g)[Symbol.iterator](),x;!(k=(x=R.next()).done);k=true){var E=l(x.value,2),O=E[0],S=E[1];s[O]="".concat(this.fk.global,".").concat(S)}}catch(e){j=true;w=e}finally{try{if(!k&&R.return!=null){R.return()}}finally{if(j){throw w}}}[17,18,19].includes(v)&&(s["react-dom/client"]=this.fk.global,s["react/jsx-runtime"]=this.fk.global,s["react/jsx-dev-runtime"]=this.fk.global)}o&&n.map(function(t){t.type==="js"&&t.module&&t.global&&(s[t.module]="".concat(e.fk.global,".").concat(t.global))}),a.setExternals&&a.setExternals(s,this.fk.global,this.rt.global),r.chain.merge({externals:s})}},{key:"setRuntimeLib",value:function e(){if(!this.op.empRuntime)return;var e=this.op.empRuntime,t=e.shareLib,r=this,n=r.store,i=r.injectHtml,a=this.op,o=a.empRuntime;this.rt.lib?this.rt.lib==="useFrameworkLib"&&!t||i.push({tagName:"script",pos:"head",attributes:{src:this.rt.lib}}):n.chain.plugin("plugin-emp-share-framework").use(O,[o])}},{key:"setMfName",value:function e(){this.op.name?(this.op.name=this.store.encodeVarName(this.op.name),this.op.name!==this.store.empConfig.output.uniqueName&&this.store.chain.output.set("uniqueName",this.op.name)):this.op.name=this.store.empConfig.output.uniqueName}},{key:"setMF",value:function e(){var e=this.op,t=this,r=t.store;if(e.name){var n;var i=r.deepAssign({filename:"emp.js"},e);i.empRuntime&&delete i.empRuntime,e.forceRemotes&&(S(r,e.forceRemotes),delete e.forceRemotes,(n=i.runtimePlugins)===null||n===void 0?void 0:n.push(y.resolve("@empjs/share/forceRemote"))),r.chain.plugin("plugin-emp-share").use(x,[i])}}},{key:"setShareLib",value:function e(){if(!this.op.empRuntime)return;var e=this.op.empRuntime,t=e.shareLib,r=this,n=r.externalsLib,i=r.injectHtml;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"){var a=true,o=false,u=undefined;try{var s=function(){var e=l(m.value,2),t=e[0],r=e[1];var i={};if(i.module=t,typeof r=="string"){var a=r.match(L)||[];a.length>0?(i.global=a[1],i.entry=a[2],i.type="js",n.push(i),i={}):(i.global="",i.entry=r,i.type="js",n.push(i),i={})}else Array.isArray(r)?r.map(function(e){if(!e)return;if(e.split("?")[0].endsWith(".css"))i.entry=e,i.type="css";else{var t=e.match(L)||[];t.length>0?(i.global=t[1],i.entry=t[2],i.type="js"):(i.global="",i.entry=e,i.type="js")}n.push(i),i={}}):(typeof r==="undefined"?"undefined":f(r))=="object"&&r.entry&&(i.entry=r.entry,i.global=r.global,i.type=r.type,n.push(i),i={})};for(var c=Object.entries(t)[Symbol.iterator](),m;!(a=(m=c.next()).done);a=true)s()}catch(e){o=true;u=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(o){throw u}}}n.map(function(e){e.type==="js"?i.push({attributes:{src:e.entry},tagName:"script"}):e.type==="css"&&i.push({attributes:{href:e.entry,rel:"stylesheet"},tagName:"link"})})}}}]);return e}();var P=function(e,t){return e=Object.assign(e,{react:"".concat(t,".React"),"react-dom":"".concat(t,".ReactDOM"),"react-dom/client":t,"react/jsx-runtime":t,"react/jsx-dev-runtime":t,"react-router-dom":"".concat(t,".ReactRouterDOM")}),e};var _=function(e,t){return e=Object.assign(e,{vue:"".concat(t,".Vue"),"vue-router":"".concat(t,".VueRouter")}),e};var F=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{name:"@empjs/share",rsConfig:function t(t){return n(function(){return m(this,function(r){e.manifest===!0?e.manifest={fileName:"emp.json"}:f(e.manifest)=="object"?e.manifest=t.deepAssign({fileName:"emp.json"},e.manifest):e.exposes&&Object.keys(e.exposes).length>0?e.manifest={fileName:"emp.json"}:e.manifest=!1,new N(e,t).setup();return[2]})})()}}},H=F;var T=H;export{T as default,P as externalReact,_ as externalVue,F as pluginRspackEmpShare};//# sourceMappingURL=index.js.map
|
|
1
|
+
import _ from"./rspack.js";export{externalReact}from"./171.js";export{externalVue}from"./68.js";export{pluginRspackEmpShare}from"./rspack.js";export default _;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/liangxiaoming/Documents/emp/packages/emp-share/dist/index.js","../src/helper/index.ts","../src/helper/config.ts","../src/helper/rspack.ts","../src/plugins/rspack/plugin.ts","../src/plugins/rspack/runtimePlugin/registerRemotes.ts","../src/plugins/rspack/utils.ts","../src/plugins/rspack/share.ts","../src/framework/react/config.ts","../src/framework/vue/config.ts","../src/plugins/rspack/index.ts","../src/index.ts"],"names":["M","Object","defineProperty","O","t","e","i","enumerable","configurable","writable","value","h","require","Proxy","get","apply","arguments","Error","m","importJsVm","content","deepAssign","target","sources","source","k","vs","vt","isDev","log","console","bind","shareGlobalName","shareGlobalVal","shareForceRemote","ModuleFederationPlugin","getShareRuntimeEntry","url","join","EmpShareRemoteLibPlugin","op","__publicField","options","compiler","webpack","entry","EntryPlugin","context","name","registerRemotes","store","forceRemotes","keys","length","injectTags","innerHTML","JSON","stringify","tagName","pos","getRuntimeLib","host","mode","dev","prod","exp","EmpShare","setup","resetRuntime","resetFramework","setMfName","setMF","injectGlobalVal","injectFramework","setShareLib","setRuntimeLib","injectToHtml","setExternal","injectHtml","fk","libs","injectFkLibs","empRuntime","lib","push","attributes","src","map","endsWith","href","rel","frameworkGlobal","global","shareLib","injectGlobalValToHtml","rt","injectData","frameworkLib","runtimeLib","framework","version","runtimeGlobal","runtime","externalsLib","externalRuntime","externals","entries","key","externalReact","react","includes","v","type","module","setExternals","chain","merge","plugin","use","encodeVarName","empConfig","output","uniqueName","set","o","filename","runtimePlugins","__require","resolve","externalsItem","cb","match","Array","isArray","vo","split","globalVal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gB,EAAQY,UACpCZ,EAAI3H,OAAOwI,MAAA,CAAOb,EAAG,CACnBf,MAAO,GAAY,OAAT2B,EAAS,UACnB,YAAa,GAAY,OAATA,EAAS,aACzB,mBAAoBA,EACpB,oBAAqBA,EACrB,wBAAyBA,EACzB,mBAAoB,GAAY,OAATA,EAAS,kBAClC,GACOZ,GCTF,IAAMc,EAAc,SAACd,EAAQY,UAClCZ,EAAI3H,OAAOwI,MAAA,CAAOb,EAAG,CACnBe,IAAK,GAAY,OAATH,EAAS,QACjB,aAAc,GAAY,OAATA,EAAS,aAC5B,GACOZ,GCIF,IAAMgB,EAAuB,eAAChB,yDAAwB,CAAC,QACrD,CACL5E,KAAM,eACA6F,SAAN,SAAMA,EAAS3F,CAAAA,gDAET0E,EAAEkB,QAAA,GAAa,CAAA,EACjBlB,EAAEkB,QAAA,CAAW,CACXC,SAAU,UACZ,EACS,EAAOnB,EAAEkB,QAAA,GAAa,SAC/BlB,EAAEkB,QAAA,CAAW5F,EAAM7B,UAAA,CAAW,CAAC0H,SAAU,UAAU,EAAGnB,EAAEkB,QAAQ,EAG7ClB,EAAEoB,OAAA,EAAW/I,OAAOmD,IAAA,CAAKwE,EAAEoB,OAAO,EAAE3F,MAAA,CAAS,EAE9DuE,EAAEkB,QAAA,CAAW,CACXC,SAAU,UACZ,EAEAnB,EAAEkB,QAAA,CAAW,CAAA,EAGA,IAAI5E,EAAS0D,EAAG1E,GACxBiB,KAAA,cACX,KACF,GAEK8E,EAAQL,ECnCf,IAAOM,EAAQD,SAAAA,KAAAA,OAAAA,CAAAA,KAAAA,aAAAA,CAAAA,KAAAA,WAAAA,CAAAA,KAAAA,oBAAAA","sourcesContent":["var M=Object.defineProperty;var O=(t,e,i)=>e in t?M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var h=(t=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(t,{get:(e,i)=>(typeof require<\"u\"?require:e)[i]}):t)(function(t){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+t+'\" is not supported')});var m=(t,e,i)=>O(t,typeof e!=\"symbol\"?e+\"\":e,i);var b=t=>`data:text/javascript,${t}`;function f(t,...e){for(let i of e)for(let r in i){let a=i[r],n=t[r];if(Object(a)==a&&Object(n)===n){t[r]=f(n,a);continue}t[r]=i[r]}return t}var P=!1,w=P?console.log.bind(console,\"[EMP Share]\"):()=>{};var y=\"EMP_SHARE_RUNTIME\",g=\"EMPShareGlobalVal\",R=\"EMP_FORCE_REMOTES\";import{ModuleFederationPlugin as j}from\"@empjs/module-federation-rspack\";var L=t=>{let e=[`import '${t}'`].join(`\n`);return b(e)},c=class{constructor(e){m(this,\"options\");this.options=e}apply(e){let{webpack:i}=e,r=L(\"@empjs/share/library\");new i.EntryPlugin(e.context,r,{name:void 0}).apply(e)}};var k=(t,e)=>{Object.keys(e).length>0&&t.injectTags([{innerHTML:`window.${R} = ${JSON.stringify(e)};`,tagName:\"script\",pos:\"head\"}],\"EMP_FORCE_REMOTES\")};function d(t,e,i=\"runtime\"){return typeof t==\"string\"?i===\"runtime\"?`${t}/runtime${e===\"development\"?\".development\":\"\"}.umd.js`:`${t}/${i}.${e}.umd.js`:typeof t==\"object\"?e===\"development\"?t.dev:t.prod:\"\"}var x=/^([0-9a-zA-Z_\\s]+)@(.*)/,u=class{constructor(e,i){m(this,\"op\");m(this,\"store\");m(this,\"injectHtml\",[]);m(this,\"externalsLib\",[]);m(this,\"fk\");m(this,\"rt\");this.op=e||{},this.store=i}setup(){this.resetRuntime(),this.resetFramework(),this.setMfName(),this.setMF(),this.injectGlobalVal(),this.injectFramework(),this.setShareLib(),this.setRuntimeLib(),this.injectToHtml(),this.setExternal()}injectToHtml(){let{store:e,injectHtml:i}=this;i.length>0&&e.injectTags(i,\"EMPShare\")}injectFramework(){if(this.fk&&this.fk.libs.length>0)return this.injectFkLibs(this.fk.libs);if(!this.op.empRuntime||!this.fk.lib)return;let{store:e,injectHtml:i}=this;if(this.fk.lib){let r=d(this.fk.lib,e.mode,this.fk.entry);i.push({attributes:{src:r},tagName:\"script\"})}}injectFkLibs(e){e.map(i=>{if(i.endsWith(\".css\"))return this.injectHtml.push({attributes:{href:i,rel:\"stylesheet\"},tagName:\"link\"});this.injectHtml.push({attributes:{src:i},tagName:\"script\"})})}injectGlobalVal(){if(!this.op.empRuntime)return;let{empRuntime:e}=this.op,{injectHtml:i}=this,r=this.fk.global||(e.shareLib?\"window\":\"\");if(!(e.injectGlobalValToHtml===!1||!this.rt.lib)){let n={frameworkLib:r,runtimeLib:this.rt.global};this.fk.name&&this.fk.name!==\"none\"&&(n.framework=this.fk.name),i.push({tagName:\"script\",innerHTML:`window.${g}=${JSON.stringify(n)}`})}}resetFramework(){if(!this.op.empRuntime)return;let{framework:e,frameworkGlobal:i,frameworkLib:r}=this.op.empRuntime;this.fk={name:\"none\",version:0,entry:\"\",global:i||\"\",lib:r||\"\",libs:[]},typeof e==\"string\"?this.fk.name=e:typeof e==\"object\"&&Object.keys(e).length>0&&(e.entry=e.entry?e.entry:e.name,this.fk=f(this.fk,e))}resetRuntime(){let{empRuntime:e}=this.op;if(!e)return;let i=e.runtimeGlobal||y,r=e.runtimeLib?e.runtimeLib:e.runtime?.lib?e.runtime.lib:\"\";this.rt={lib:r,global:i}}setExternal(){if(!this.op.empRuntime)return;let{store:e,externalsLib:i}=this,{empRuntime:r}=this.op,{shareLib:a}=r,n=this.rt.lib?{\"@module-federation/runtime\":\"MFRuntime\",\"@module-federation/sdk\":\"MFSDK\"}:{},s={};for(let[o,p]of Object.entries(n))s[o]=`${this.rt.global}.${p}`;if(this.fk.name===\"react\"&&!a&&this.fk.global){let o=this.fk.version,p={react:\"React\",\"react-dom\":\"ReactDOM\"};this.fk.entry===\"reactRouter\"&&(p[\"react-router-dom\"]=\"ReactRouterDOM\");for(let[l,S]of Object.entries(p))s[l]=`${this.fk.global}.${S}`;[17,18,19].includes(o)&&(s[\"react-dom/client\"]=this.fk.global,s[\"react/jsx-runtime\"]=this.fk.global,s[\"react/jsx-dev-runtime\"]=this.fk.global)}a&&i.map(o=>{o.type===\"js\"&&o.module&&o.global&&(s[o.module]=`${this.fk.global}.${o.global}`)}),r.setExternals&&r.setExternals(s,this.fk.global,this.rt.global),e.chain.merge({externals:s})}setRuntimeLib(){if(!this.op.empRuntime)return;let{shareLib:e}=this.op.empRuntime,{store:i,injectHtml:r}=this,{empRuntime:a}=this.op;this.rt.lib?this.rt.lib===\"useFrameworkLib\"&&!e||r.push({tagName:\"script\",pos:\"head\",attributes:{src:this.rt.lib}}):i.chain.plugin(\"plugin-emp-share-framework\").use(c,[a])}setMfName(){this.op.name?(this.op.name=this.store.encodeVarName(this.op.name),this.op.name!==this.store.empConfig.output.uniqueName&&this.store.chain.output.set(\"uniqueName\",this.op.name)):this.op.name=this.store.empConfig.output.uniqueName}setMF(){let e=this.op,{store:i}=this;if(e.name){let r=i.deepAssign({filename:\"emp.js\"},e);r.empRuntime&&delete r.empRuntime,e.forceRemotes&&(k(i,e.forceRemotes),delete e.forceRemotes,r.runtimePlugins?.push(h.resolve(\"@empjs/share/forceRemote\"))),i.chain.plugin(\"plugin-emp-share\").use(j,[r])}}setShareLib(){if(!this.op.empRuntime)return;let{shareLib:e}=this.op.empRuntime,{externalsLib:i,injectHtml:r}=this;if(e&&typeof e==\"object\"){for(let[a,n]of Object.entries(e)){let s={};if(s.module=a,typeof n==\"string\"){let o=n.match(x)||[];o.length>0?(s.global=o[1],s.entry=o[2],s.type=\"js\",i.push(s),s={}):(s.global=\"\",s.entry=n,s.type=\"js\",i.push(s),s={})}else Array.isArray(n)?n.map(o=>{if(!o)return;if(o.split(\"?\")[0].endsWith(\".css\"))s.entry=o,s.type=\"css\";else{let l=o.match(x)||[];l.length>0?(s.global=l[1],s.entry=l[2],s.type=\"js\"):(s.global=\"\",s.entry=o,s.type=\"js\")}i.push(s),s={}}):typeof n==\"object\"&&n.entry&&(s.entry=n.entry,s.global=n.global,s.type=n.type,i.push(s),s={})}i.map(a=>{a.type===\"js\"?r.push({attributes:{src:a.entry},tagName:\"script\"}):a.type===\"css\"&&r.push({attributes:{href:a.entry,rel:\"stylesheet\"},tagName:\"link\"})})}}};var B=(t,e)=>(t=Object.assign(t,{react:`${e}.React`,\"react-dom\":`${e}.ReactDOM`,\"react-dom/client\":e,\"react/jsx-runtime\":e,\"react/jsx-dev-runtime\":e,\"react-router-dom\":`${e}.ReactRouterDOM`}),t);var X=(t,e)=>(t=Object.assign(t,{vue:`${e}.Vue`,\"vue-router\":`${e}.VueRouter`}),t);var T=(t={})=>({name:\"@empjs/share\",async rsConfig(e){t.manifest===!0?t.manifest={fileName:\"emp.json\"}:typeof t.manifest==\"object\"?t.manifest=e.deepAssign({fileName:\"emp.json\"},t.manifest):t.exposes&&Object.keys(t.exposes).length>0?t.manifest={fileName:\"emp.json\"}:t.manifest=!1,new u(t,e).setup()}}),E=T;var oe=E;export{oe as default,B as externalReact,X as externalVue,T as pluginRspackEmpShare};\n","export const importJsVm = (content: string) => `data:text/javascript,${content}`\n\nexport function deepAssign<T>(target: any, ...sources: any): T {\n for (const source of sources) {\n for (const k in source) {\n const vs = source[k],\n vt = target[k]\n if (Object(vs) == vs && Object(vt) === vt) {\n target[k] = deepAssign(vt, vs)\n continue\n }\n target[k] = source[k]\n }\n }\n return target\n}\n\nexport const checkVersion = (version: string) => (version ? Number(version.split('.')[0]) : 0)\nexport const isPromise = (p: any) => p && Object.prototype.toString.call(p) === '[object Promise]'\n\n//\nexport const isDev = process.env.EMPSHARE_ENV === 'dev'\nexport const log = isDev ? console.log.bind(console, '[EMP Share]') : () => {}\n","export const shareGlobalName = 'EMP_SHARE_RUNTIME'\nexport const shareGlobalVal = 'EMPShareGlobalVal'\nexport const shareForceRemote = 'EMP_FORCE_REMOTES'\n","// export {ModuleFederationPlugin} from '@module-federation/rspack'\nexport {ModuleFederationPlugin} from '@empjs/module-federation-rspack'\n","import {Compiler} from '@empjs/cli'\nimport {importJsVm} from 'src/helper'\nimport type {EMPSHARERuntimeOptions} from './types'\n\nconst getShareRuntimeEntry = url => {\n const content = [`import '${url}'`].join('\\n')\n return importJsVm(content)\n}\n// 当没有设置 runtimeLib 时候需要内置\nexport class EmpShareRemoteLibPlugin {\n options: EMPSHARERuntimeOptions\n constructor(op: EMPSHARERuntimeOptions) {\n this.options = op\n }\n apply(compiler: Compiler) {\n const {webpack} = compiler\n const entry = getShareRuntimeEntry('@empjs/share/library')\n new webpack.EntryPlugin(compiler.context, entry, {\n name: undefined,\n }).apply(compiler)\n }\n}\n","import {type GlobalStore} from '@empjs/cli'\nimport {shareForceRemote} from 'src/helper/config'\nimport {ForceRemoteOptions} from '../types'\n\nexport const registerRemotes = (store: GlobalStore, forceRemotes: ForceRemoteOptions) => {\n if (Object.keys(forceRemotes).length > 0) {\n store.injectTags(\n [\n {\n innerHTML: `window.${shareForceRemote} = ${JSON.stringify(forceRemotes)};`,\n tagName: 'script',\n pos: 'head',\n },\n ],\n 'EMP_FORCE_REMOTES',\n )\n }\n}\n","import type {EMPSHARERuntimeOptions} from './types'\nexport function getRuntimeLib(host: EMPSHARERuntimeOptions['frameworkLib'], mode: string, entry = 'runtime') {\n if (typeof host === 'string') {\n if (entry === 'runtime') {\n return `${host}/runtime${mode === 'development' ? '.development' : ''}.umd.js`\n } else {\n return `${host}/${entry}.${mode}.umd.js`\n }\n } else if (typeof host === 'object') {\n if (mode === 'development') return host.dev\n else return host.prod\n }\n return ''\n}\n","import type {GlobalStore} from '@empjs/cli'\nimport {deepAssign} from 'src/helper'\nimport {shareGlobalName, shareGlobalVal} from 'src/helper/config'\nimport {ModuleFederationPlugin} from 'src/helper/rspack'\nimport {EmpShareRemoteLibPlugin} from './plugin'\nimport {registerRemotes} from './runtimePlugin/registerRemotes'\nimport type {\n EMPPluginShareType,\n ExternalsItemType,\n frameworkOptions,\n ModuleFederationPluginOptions,\n runtimeLibType,\n} from './types'\nimport {getRuntimeLib} from './utils'\n\nconst exp = /^([0-9a-zA-Z_\\s]+)@(.*)/\nexport class EmpShare {\n private op: EMPPluginShareType\n private store: GlobalStore\n /**\n * 注入资源\n */\n private injectHtml: any[] = []\n /**\n * 兼容 shareLib\n */\n private externalsLib: ExternalsItemType[] = []\n constructor(op: EMPPluginShareType, store: GlobalStore) {\n this.op = op || {}\n this.store = store\n }\n setup() {\n this.resetRuntime()\n this.resetFramework()\n this.setMfName() //设置 mfName 默认为 uniqueName\n this.setMF() // 设置 MF 配置\n this.injectGlobalVal() // 插入全局变量 方便emp外的项目调用\n this.injectFramework() // 插入ui框架库\n this.setShareLib() //兼容 emp Sharelib的共享模型设置\n this.setRuntimeLib() // 设置 MF SDK\n this.injectToHtml() //触发插入动作\n this.setExternal() // 设置 external 降低包体\n }\n private injectToHtml() {\n const {store, injectHtml} = this\n if (injectHtml.length > 0) {\n store.injectTags(injectHtml, 'EMPShare')\n }\n }\n private injectFramework() {\n if (this.fk && this.fk.libs.length > 0) {\n return this.injectFkLibs(this.fk.libs)\n }\n if (!this.op.empRuntime || !this.fk.lib) return\n const {store, injectHtml} = this\n if (this.fk.lib) {\n const url = getRuntimeLib(this.fk.lib, store.mode, this.fk.entry)\n injectHtml.push({\n attributes: {\n src: url,\n },\n tagName: 'script',\n })\n }\n }\n private injectFkLibs(libs: string[]) {\n libs.map(url => {\n if (url.endsWith('.css')) {\n return this.injectHtml.push({\n attributes: {\n href: url,\n rel: 'stylesheet',\n },\n tagName: 'link',\n })\n }\n this.injectHtml.push({\n attributes: {\n src: url,\n },\n tagName: 'script',\n })\n })\n }\n private injectGlobalVal() {\n if (!this.op.empRuntime) return\n const {empRuntime} = this.op\n const {injectHtml} = this\n const frameworkGlobal = this.fk.global || (empRuntime.shareLib ? 'window' : '')\n const injectGlobalValToHtml = empRuntime.injectGlobalValToHtml === false || !this.rt.lib ? false : true\n // 插入全局引用变量 让 empRuntime 可以提前实例化 不需要在页面重复实例化\n if (injectGlobalValToHtml) {\n const injectData: any = {frameworkLib: frameworkGlobal, runtimeLib: this.rt.global}\n if (this.fk.name && this.fk.name !== 'none') injectData.framework = this.fk.name\n injectHtml.push({\n // type: 'js',\n tagName: 'script',\n innerHTML: `window.${shareGlobalVal}=${JSON.stringify(injectData)}`,\n })\n }\n }\n public fk!: Required<frameworkOptions>\n private resetFramework() {\n if (!this.op.empRuntime) return\n const {framework, frameworkGlobal, frameworkLib} = this.op.empRuntime\n //\n this.fk = {\n name: 'none',\n version: 0,\n entry: '',\n global: frameworkGlobal || '',\n lib: frameworkLib || '',\n libs: [],\n }\n //\n if (typeof framework === 'string') {\n this.fk.name = framework as any\n }\n // TODO 通用 CDN 的适配方案\n else if (typeof framework === 'object' && Object.keys(framework).length > 0) {\n // 默认 框架名 为入口\n framework.entry = framework.entry ? framework.entry : framework.name\n this.fk = deepAssign(this.fk, framework)\n }\n }\n public rt!: Required<runtimeLibType>\n private resetRuntime() {\n const {empRuntime} = this.op\n if (!empRuntime) return\n const global = empRuntime.runtimeGlobal || shareGlobalName\n const lib = empRuntime.runtimeLib ? empRuntime.runtimeLib : empRuntime.runtime?.lib ? empRuntime.runtime.lib : ''\n this.rt = {\n lib,\n global,\n }\n }\n private setExternal() {\n if (!this.op.empRuntime) return\n const {store, externalsLib} = this\n const {empRuntime} = this.op\n const {shareLib} = empRuntime\n //\n const externalRuntime = this.rt.lib\n ? {\n '@module-federation/runtime': `MFRuntime`,\n '@module-federation/sdk': `MFSDK`,\n }\n : {}\n const externals = {}\n for (const [key, value] of Object.entries(externalRuntime)) {\n externals[key] = `${this.rt.global}.${value}`\n }\n /**\n * TODO\n * 框架相关内容需要移除 share 由外部简化配置实现\n */\n if (this.fk.name === 'react' && !shareLib && this.fk.global) {\n const version = this.fk.version\n const externalReact = {\n react: `React`,\n 'react-dom': `ReactDOM`,\n }\n if (this.fk.entry === 'reactRouter') {\n externalReact['react-router-dom'] = 'ReactRouterDOM'\n }\n for (const [key, value] of Object.entries(externalReact)) {\n externals[key] = `${this.fk.global}.${value}`\n }\n if ([17, 18, 19].includes(version)) {\n externals['react-dom/client'] = this.fk.global\n externals['react/jsx-runtime'] = this.fk.global\n externals['react/jsx-dev-runtime'] = this.fk.global\n }\n }\n if (shareLib) {\n externalsLib.map(v => {\n if (v.type === 'js' && v.module && v.global) {\n externals[v.module] = `${this.fk.global}.${v.global}`\n }\n })\n }\n if (empRuntime.setExternals) empRuntime.setExternals(externals, this.fk.global, this.rt.global)\n //\n // console.log('externals in plugin', externals)\n store.chain.merge({externals})\n }\n private setRuntimeLib() {\n if (!this.op.empRuntime) return\n\n const {shareLib} = this.op.empRuntime\n const {store, injectHtml} = this\n const {empRuntime} = this.op\n if (!this.rt.lib) {\n // 内置 this.rt.lib\n store.chain.plugin('plugin-emp-share-framework').use(EmpShareRemoteLibPlugin, [empRuntime])\n }\n // 统一封装到 frameworkLib\n else if (this.rt.lib === 'useFrameworkLib' && !shareLib) {\n } else {\n // 插入 runtime\n injectHtml.push({tagName: 'script', pos: 'head', attributes: {src: this.rt.lib}})\n }\n }\n private setMfName() {\n if (this.op.name) {\n this.op.name = this.store.encodeVarName(this.op.name)\n if (this.op.name !== this.store.empConfig.output.uniqueName) {\n this.store.chain.output.set('uniqueName', this.op.name)\n }\n } else {\n this.op.name = this.store.empConfig.output.uniqueName\n }\n }\n private setMF() {\n const o = this.op\n const {store} = this\n if (o.name) {\n const op = store.deepAssign<ModuleFederationPluginOptions & {empRuntime: any}>(\n {\n filename: 'emp.js',\n // manifest: false,\n // dts: false,\n // dev: {\n // disableDynamicRemoteTypeHints: true,\n // },\n },\n o,\n )\n //\n // if (o.dev === false) op.dev = false\n //\n if (op.empRuntime) {\n delete op.empRuntime\n }\n /**\n * 注册 forceRemotes\n */\n if (o.forceRemotes) {\n registerRemotes(store, o.forceRemotes)\n delete o.forceRemotes\n op.runtimePlugins?.push(require.resolve('@empjs/share/forceRemote'))\n }\n // console.log('op', op)\n store.chain.plugin('plugin-emp-share').use(ModuleFederationPlugin, [op])\n }\n }\n private setShareLib() {\n if (!this.op.empRuntime) return\n const {shareLib} = this.op.empRuntime\n const {externalsLib, injectHtml} = this\n if (shareLib && typeof shareLib === 'object') {\n for (const [k, v] of Object.entries(shareLib)) {\n let externalsItem: ExternalsItemType = {}\n externalsItem.module = k\n //增加下划线 支持lodash 等特殊符号的问题 如 _@http\n\n if (typeof v === 'string') {\n const cb: any = v.match(exp) || []\n if (cb.length > 0) {\n externalsItem.global = cb[1]\n externalsItem.entry = cb[2]\n externalsItem.type = 'js'\n externalsLib.push(externalsItem)\n externalsItem = {}\n } else {\n externalsItem.global = ''\n externalsItem.entry = v\n externalsItem.type = 'js'\n externalsLib.push(externalsItem)\n externalsItem = {}\n }\n } else if (Array.isArray(v)) {\n v.map(vo => {\n if (!vo) return\n const isCSS = vo.split('?')[0].endsWith('.css')\n if (isCSS) {\n externalsItem.entry = vo\n externalsItem.type = 'css'\n } else {\n const cb: any = vo.match(exp) || []\n if (cb.length > 0) {\n externalsItem.global = cb[1]\n externalsItem.entry = cb[2]\n externalsItem.type = 'js'\n } else {\n externalsItem.global = ''\n externalsItem.entry = vo\n externalsItem.type = 'js'\n }\n }\n externalsLib.push(externalsItem)\n externalsItem = {}\n })\n } else if (typeof v === 'object' && v.entry) {\n externalsItem.entry = v.entry\n externalsItem.global = v.global\n externalsItem.type = v.type\n externalsLib.push(externalsItem)\n externalsItem = {}\n }\n }\n // console.log(externalsLib)\n externalsLib.map(v => {\n if (v.type === 'js') {\n injectHtml.push({\n attributes: {\n src: v.entry,\n },\n tagName: 'script',\n })\n } else if (v.type === 'css') {\n injectHtml.push({\n attributes: {\n href: v.entry,\n rel: 'stylesheet',\n },\n tagName: 'link',\n })\n }\n })\n }\n }\n}\n","export const externalReact = (o: any, globalVal: string) => {\n o = Object.assign(o, {\n react: `${globalVal}.React`,\n 'react-dom': `${globalVal}.ReactDOM`,\n 'react-dom/client': globalVal,\n 'react/jsx-runtime': globalVal,\n 'react/jsx-dev-runtime': globalVal,\n 'react-router-dom': `${globalVal}.ReactRouterDOM`,\n })\n return o\n}\n","export const externalVue = (o: any, globalVal: string) => {\n o = Object.assign(o, {\n vue: `${globalVal}.Vue`,\n 'vue-router': `${globalVal}.VueRouter`,\n })\n return o\n}\n","import type {GlobalStore} from '@empjs/cli'\nimport {EmpShare} from './share'\nimport type {EMPPluginShareType} from './types'\nexport type {EMPPluginShareType}\n//\nexport * from 'src/framework/react/config'\nexport * from 'src/framework/vue/config'\nexport * from './types'\n//\nexport const pluginRspackEmpShare = (o: EMPPluginShareType = {}) => {\n return {\n name: '@empjs/share',\n async rsConfig(store: GlobalStore) {\n //\n if (o.manifest === true) {\n o.manifest = {\n fileName: 'emp.json',\n }\n } else if (typeof o.manifest === 'object') {\n o.manifest = store.deepAssign({fileName: 'emp.json'}, o.manifest)\n } else {\n // 默认情况下,如果 exposes 为空则不生成 manifest 避免冲突\n const hasExposes = o.exposes && Object.keys(o.exposes).length > 0\n if (hasExposes) {\n o.manifest = {\n fileName: 'emp.json',\n }\n } else {\n o.manifest = false\n }\n }\n const empShare = new EmpShare(o, store)\n empShare.setup()\n },\n }\n}\nexport default pluginRspackEmpShare\n","import {default as pluginRspackEmpShare} from 'src/plugins/rspack'\nexport default pluginRspackEmpShare\nexport * from 'src/plugins/rspack'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import {default as pluginRspackEmpShare} from 'src/plugins/rspack'\nexport default pluginRspackEmpShare\nexport * from 'src/plugins/rspack'\n"],"names":["pluginRspackEmpShare"],"mappings":"+MACeA,C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import 'core-js/stable/global-this';
|
|
2
|
+
import 'core-js/stable/object/entries';
|
|
3
|
+
import { reactAdapter } from '../adapter';
|
|
4
|
+
import { MFRuntime, MFSDK } from '../helper/moduleFederation';
|
|
5
|
+
import { EMPRuntime } from '../runtime';
|
|
6
|
+
declare const runtime: EMPRuntime;
|
|
7
|
+
export { MFRuntime, MFSDK, reactAdapter, runtime };
|
package/dist/mfRuntime.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './runtime/mfRuntime'
|
package/dist/mfRuntime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"@module-federation/runtime"
|
|
1
|
+
export*from"@module-federation/runtime";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GlobalStore } from '@empjs/cli';
|
|
2
|
+
import type { EMPPluginShareType } from './types';
|
|
3
|
+
export type { EMPPluginShareType };
|
|
4
|
+
export * from '../../framework/react/config';
|
|
5
|
+
export * from '../../framework/vue/config';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export declare const pluginRspackEmpShare: (o?: EMPPluginShareType) => {
|
|
8
|
+
name: string;
|
|
9
|
+
rsConfig(store: GlobalStore): Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export default pluginRspackEmpShare;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时插件:根据 window[EMP_FORCE_REMOTES] 配置,在注册 remote 前拦截并改写其 entry/url。
|
|
3
|
+
* 支持两种方式二选一:指定完整 entry 地址,或仅指定 version 做 URL 内版本号替换。
|
|
4
|
+
*/
|
|
5
|
+
import { type ModuleFederationRuntimePlugin } from '@module-federation/runtime';
|
|
6
|
+
import { shareForceRemote } from '../../../helper/config';
|
|
7
|
+
import { type ForceRemoteOptions } from '../types';
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
[shareForceRemote]?: ForceRemoteOptions;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export default function (): ModuleFederationRuntimePlugin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { GlobalStore } from '@empjs/cli';
|
|
2
|
+
import type { EMPPluginShareType, frameworkOptions, runtimeLibType } from './types';
|
|
3
|
+
export declare class EmpShare {
|
|
4
|
+
private op;
|
|
5
|
+
private store;
|
|
6
|
+
/**
|
|
7
|
+
* 注入资源
|
|
8
|
+
*/
|
|
9
|
+
private injectHtml;
|
|
10
|
+
/**
|
|
11
|
+
* 兼容 shareLib
|
|
12
|
+
*/
|
|
13
|
+
private externalsLib;
|
|
14
|
+
constructor(op: EMPPluginShareType, store: GlobalStore);
|
|
15
|
+
setup(): void;
|
|
16
|
+
private injectToHtml;
|
|
17
|
+
private injectFramework;
|
|
18
|
+
private injectFkLibs;
|
|
19
|
+
private injectGlobalVal;
|
|
20
|
+
fk: Required<frameworkOptions>;
|
|
21
|
+
private resetFramework;
|
|
22
|
+
rt: Required<runtimeLibType>;
|
|
23
|
+
private resetRuntime;
|
|
24
|
+
private setExternal;
|
|
25
|
+
private setRuntimeLib;
|
|
26
|
+
private setMfName;
|
|
27
|
+
private setMF;
|
|
28
|
+
private setDtsRuntimePkgs;
|
|
29
|
+
private setShareLib;
|
|
30
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ModuleFederationPlugin } from '
|
|
2
|
-
|
|
3
|
-
type
|
|
4
|
-
type EMPSHARERuntimeOptions = {
|
|
1
|
+
import type { ModuleFederationPlugin } from '../../helper/rspack';
|
|
2
|
+
export type ModuleFederationPluginOptions = ConstructorParameters<typeof ModuleFederationPlugin>[0];
|
|
3
|
+
export type EMPSHARERuntimeOptions = {
|
|
5
4
|
/**
|
|
6
5
|
* 兼容 emp2.0 shareLib 配置
|
|
7
6
|
*/
|
|
@@ -36,7 +35,7 @@ type EMPSHARERuntimeOptions = {
|
|
|
36
35
|
*/
|
|
37
36
|
frameworkLib?: frameworLibType;
|
|
38
37
|
};
|
|
39
|
-
type runtimeLibType = {
|
|
38
|
+
export type runtimeLibType = {
|
|
40
39
|
/**
|
|
41
40
|
* MFRuntime 地址
|
|
42
41
|
*/
|
|
@@ -46,11 +45,11 @@ type runtimeLibType = {
|
|
|
46
45
|
*/
|
|
47
46
|
global?: string;
|
|
48
47
|
};
|
|
49
|
-
type frameworLibType = string | {
|
|
48
|
+
export type frameworLibType = string | {
|
|
50
49
|
dev: string;
|
|
51
50
|
prod: string;
|
|
52
51
|
};
|
|
53
|
-
type frameworkOptions = {
|
|
52
|
+
export type frameworkOptions = {
|
|
54
53
|
/**
|
|
55
54
|
* 框架名称
|
|
56
55
|
*/
|
|
@@ -81,7 +80,7 @@ type frameworkOptions = {
|
|
|
81
80
|
/**
|
|
82
81
|
* runtime beforeRegisterRemote 收到的 remote 对象结构(与 @module-federation/runtime Remote 兼容)
|
|
83
82
|
*/
|
|
84
|
-
type RemoteInfoForForce = {
|
|
83
|
+
export type RemoteInfoForForce = {
|
|
85
84
|
/** 唯一标识,如 @nova/bigolive-common,用于匹配 forceRemotes key(优先于 name) */
|
|
86
85
|
alias?: string;
|
|
87
86
|
/** 占位名,如 $1,可能重名;插件会为占位名生成唯一 name */
|
|
@@ -100,12 +99,12 @@ type RemoteInfoForForce = {
|
|
|
100
99
|
* 单项配置:仅替换 URL 中 `key@oldVer` 的版本部分
|
|
101
100
|
* @example "17.0.0"
|
|
102
101
|
*/
|
|
103
|
-
type ForceRemoteVersion = string;
|
|
102
|
+
export type ForceRemoteVersion = string;
|
|
104
103
|
/**
|
|
105
104
|
* 单项配置:显式指定仅替换版本(与 string 等价,便于扩展)
|
|
106
105
|
* @example { version: "17.0.0" }
|
|
107
106
|
*/
|
|
108
|
-
type ForceRemoteVersionOption = {
|
|
107
|
+
export type ForceRemoteVersionOption = {
|
|
109
108
|
version: string;
|
|
110
109
|
};
|
|
111
110
|
/**
|
|
@@ -113,7 +112,7 @@ type ForceRemoteVersionOption = {
|
|
|
113
112
|
* 匹配时优先用 alias(唯一标识,如 @nova/bigolive-common),避免 name 为 $1 等占位符导致重名
|
|
114
113
|
* @example { entry: "https://cdn.example.com/app1.js" }
|
|
115
114
|
*/
|
|
116
|
-
type ForceRemoteEntryOption = {
|
|
115
|
+
export type ForceRemoteEntryOption = {
|
|
117
116
|
entry: string;
|
|
118
117
|
};
|
|
119
118
|
/**
|
|
@@ -121,13 +120,13 @@ type ForceRemoteEntryOption = {
|
|
|
121
120
|
* - string / { version }:对所有 remote 的 entry/url/manifest 中 `key@xxx` 做版本替换
|
|
122
121
|
* - { entry }:key 为 remote 的 alias(优先)或 name 时,对该 remote 做整入口替换
|
|
123
122
|
*/
|
|
124
|
-
type ForceRemoteItem = ForceRemoteVersion | ForceRemoteVersionOption | ForceRemoteEntryOption;
|
|
125
|
-
type ForceRemoteOptions = Record<string, ForceRemoteItem>;
|
|
126
|
-
type EMPPluginShareType = ModuleFederationPluginOptions & {
|
|
123
|
+
export type ForceRemoteItem = ForceRemoteVersion | ForceRemoteVersionOption | ForceRemoteEntryOption;
|
|
124
|
+
export type ForceRemoteOptions = Record<string, ForceRemoteItem>;
|
|
125
|
+
export type EMPPluginShareType = ModuleFederationPluginOptions & {
|
|
127
126
|
empRuntime?: EMPSHARERuntimeOptions;
|
|
128
127
|
forceRemotes?: ForceRemoteOptions;
|
|
129
128
|
};
|
|
130
|
-
type ExternalsItemType = {
|
|
129
|
+
export type ExternalsItemType = {
|
|
131
130
|
/**
|
|
132
131
|
* 模块名
|
|
133
132
|
* @example react-dom
|
|
@@ -153,5 +152,3 @@ type ExternalsItemType = {
|
|
|
153
152
|
*/
|
|
154
153
|
type?: string;
|
|
155
154
|
};
|
|
156
|
-
|
|
157
|
-
export type { EMPPluginShareType as E, ForceRemoteVersion as F, ModuleFederationPluginOptions as M, RemoteInfoForForce as R, EMPSHARERuntimeOptions as a, frameworkOptions as b, ForceRemoteVersionOption as c, ForceRemoteEntryOption as d, ForceRemoteItem as e, frameworLibType as f, ForceRemoteOptions as g, ExternalsItemType as h, runtimeLibType as r };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import '@module-federation/runtime';
|
|
3
|
-
import '@module-federation/sdk';
|
|
4
|
-
|
|
5
|
-
declare const shared: () => InitOptionsType["shared"];
|
|
6
|
-
|
|
7
|
-
declare const external: (o: any, globalVal: string) => any;
|
|
8
|
-
|
|
9
|
-
export { external, shared };
|
|
1
|
+
export * from './framework/react/index'
|
package/dist/react.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{externalReact as e}from"./171.js";let r=window,n={},{EMPShareGlobalVal:o}=r||{};o&&o.frameworkLib&&(n=r[o.frameworkLib]);let t=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){var o;o=n[r],r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o})}return e}({scope:"default"},n),i=()=>{let{React:e,ReactDOM:r,scope:n}=t;return{react:{lib:()=>e,version:e.version,scope:n,shareConfig:{singleton:!0,requiredVersion:`^${e.version}`}},"react-dom":{lib:()=>r,version:r.version,scope:n,shareConfig:{singleton:!0,requiredVersion:`^${e.version}`}}}},l=e;export{l as external,i as shared};
|
|
2
|
+
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../src/framework/react/shared.ts","../src/framework/react/index.ts"],"sourcesContent":["import {EMPShareRuntimeAdapterReactType, InitOptionsType} from 'src/types'\n\nconst win: any = window\nlet globalLib = {}\nconst {EMPShareGlobalVal} = win || {}\nif (EMPShareGlobalVal && EMPShareGlobalVal.frameworkLib) {\n globalLib = win[EMPShareGlobalVal.frameworkLib]\n}\nconst libs: EMPShareRuntimeAdapterReactType = {\n scope: 'default',\n ...globalLib,\n}\nexport const shared = (): InitOptionsType['shared'] => {\n const {React, ReactDOM, scope} = libs\n return {\n react: {\n lib: () => React,\n version: React.version,\n scope,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n lib: () => ReactDOM,\n version: ReactDOM.version,\n scope,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n }\n}\n","import {externalReact} from './config'\nimport {shared} from './shared'\n\nconst external = externalReact\nexport {shared, external}\n"],"names":["win","window","globalLib","EMPShareGlobalVal","libs","shared","React","ReactDOM","scope","external","externalReact"],"mappings":"uDAEA,IAAMA,EAAWC,OACbC,EAAY,CAAC,EACX,CAACC,kBAAAA,CAAiB,CAAC,CAAGH,GAAO,CAAC,CAChCG,CAAAA,GAAqBA,EAAkB,YAAY,EACrDD,CAAAA,EAAYF,CAAG,CAACG,EAAkB,YAAY,CAAC,AAAD,EAEhD,IAAMC,EAAwC,A,iaAAA,CAC5C,MAAO,S,EACJF,GAEQG,EAAS,KACpB,GAAM,CAACC,MAAAA,CAAK,CAAEC,SAAAA,CAAQ,CAAEC,MAAAA,CAAK,CAAC,CAAGJ,EACjC,MAAO,CACL,MAAO,CACL,IAAK,IAAME,EACX,QAASA,EAAM,OAAO,CACtBE,MAAAA,EACA,YAAa,CACX,UAAW,GACX,gBAAiB,CAAC,CAAC,EAAEF,EAAM,OAAO,CAAC,CAAC,AACtC,CACF,EACA,YAAa,CACX,IAAK,IAAMC,EACX,QAASA,EAAS,OAAO,CACzBC,MAAAA,EACA,YAAa,CACX,UAAW,GACX,gBAAiB,CAAC,CAAC,EAAEF,EAAM,OAAO,CAAC,CAAC,AACtC,CACF,CACF,CACF,EC/BMG,EAAWC,S"}
|
package/dist/rspack.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { a as EMPSHARERuntimeOptions, h as ExternalsItemType, d as ForceRemoteEntryOption, e as ForceRemoteItem, g as ForceRemoteOptions, F as ForceRemoteVersion, c as ForceRemoteVersionOption, M as ModuleFederationPluginOptions, R as RemoteInfoForForce, f as frameworLibType, b as frameworkOptions, r as runtimeLibType } from './types-BGnQUQ0O.js';
|
|
4
|
-
import '@empjs/module-federation-rspack';
|
|
5
|
-
|
|
6
|
-
declare const externalReact: (o: any, globalVal: string) => any;
|
|
7
|
-
|
|
8
|
-
declare const externalVue: (o: any, globalVal: string) => any;
|
|
9
|
-
|
|
10
|
-
declare const pluginRspackEmpShare: (o?: EMPPluginShareType) => {
|
|
11
|
-
name: string;
|
|
12
|
-
rsConfig(store: GlobalStore): Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { EMPPluginShareType, pluginRspackEmpShare as default, externalReact, externalVue, pluginRspackEmpShare };
|
|
1
|
+
export {default} from './plugins/rspack/index'
|
|
2
|
+
export * from './plugins/rspack/index'
|
package/dist/rspack.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t,r,n,i,a,o){try{var u=e[a](o);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,i)}}function n(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var o=e.apply(t,n);function u(e){r(o,i,a,u,s,"next",e)}function s(e){r(o,i,a,u,s,"throw",e)}u(undefined)})}}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function o(e,t,r){if(t)a(e.prototype,t);if(r)a(e,r);return e}function u(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var i=true;var a=false;var o,u;try{for(r=r.call(e);!(i=(o=r.next()).done);i=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,r){return t(e)||u(e,r)||c(e,r)||s()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function c(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function m(e,t){var r,n,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=u(0),o["throw"]=u(1),o["return"]=u(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(a=0)),a)try{if(r=1,n&&(i=u[0]&2?n["return"]:u[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;if(n=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(u[0]===6&&a.label<i[1]){a.label=i[1];i=u;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(u);break}if(i[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var h=Object.defineProperty;var p=function(e,t,r){return t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var y=function(e){return(typeof require==="undefined"?"undefined":f(require))<"u"?require:(typeof Proxy==="undefined"?"undefined":f(Proxy))<"u"?new Proxy(e,{get:function(e,t){return((typeof require==="undefined"?"undefined":f(require))<"u"?require:e)[t]}}):e}(function(e){if((typeof require==="undefined"?"undefined":f(require))<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var b=function(e,t,r){return p(e,(typeof t==="undefined"?"undefined":f(t))!="symbol"?t+"":t,r)};var d=function(e){return"data:text/javascript,".concat(e)};function v(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var i=true,a=false,o=undefined;try{for(var u=r[Symbol.iterator](),s;!(i=(s=u.next()).done);i=true){var l=s.value;for(var f in l){var c=l[f],m=e[f];if(Object(c)==c&&Object(m)===m){e[f]=v(m,c);continue}e[f]=l[f]}}}catch(e){a=true;o=e}finally{try{if(!i&&u.return!=null){u.return()}}finally{if(a){throw o}}}return e}var g=!1,k=g?console.log.bind(console,"[EMP Share]"):function(){};var j="EMP_SHARE_RUNTIME",w="EMPShareGlobalVal",R="EMP_FORCE_REMOTES";import{ModuleFederationPlugin as x}from"@empjs/module-federation-rspack";var E=function(e){var t=["import '".concat(e,"'")].join("\n");return d(t)},O=/*#__PURE__*/function(){"use strict";function e(t){i(this,e);b(this,"options");this.options=t}o(e,[{key:"apply",value:function e(e){var t=e.webpack,r=E("@empjs/share/library");new t.EntryPlugin(e.context,r,{name:void 0}).apply(e)}}]);return e}();var S=function(e,t){Object.keys(t).length>0&&e.injectTags([{innerHTML:"window.".concat(R," = ").concat(JSON.stringify(t),";"),tagName:"script",pos:"head"}],"EMP_FORCE_REMOTES")};function M(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"runtime";return typeof e=="string"?r==="runtime"?"".concat(e,"/runtime").concat(t==="development"?".development":"",".umd.js"):"".concat(e,"/").concat(r,".").concat(t,".umd.js"):(typeof e==="undefined"?"undefined":f(e))=="object"?t==="development"?e.dev:e.prod:""}var L=/^([0-9a-zA-Z_\s]+)@(.*)/,N=/*#__PURE__*/function(){"use strict";function e(t,r){i(this,e);b(this,"op");b(this,"store");b(this,"injectHtml",[]);b(this,"externalsLib",[]);b(this,"fk");b(this,"rt");this.op=t||{},this.store=r}o(e,[{key:"setup",value:function e(){this.resetRuntime(),this.resetFramework(),this.setMfName(),this.setMF(),this.injectGlobalVal(),this.injectFramework(),this.setShareLib(),this.setRuntimeLib(),this.injectToHtml(),this.setExternal()}},{key:"injectToHtml",value:function e(){var e=this,t=e.store,r=e.injectHtml;r.length>0&&t.injectTags(r,"EMPShare")}},{key:"injectFramework",value:function e(){if(this.fk&&this.fk.libs.length>0)return this.injectFkLibs(this.fk.libs);if(!this.op.empRuntime||!this.fk.lib)return;var e=this,t=e.store,r=e.injectHtml;if(this.fk.lib){var n=M(this.fk.lib,t.mode,this.fk.entry);r.push({attributes:{src:n},tagName:"script"})}}},{key:"injectFkLibs",value:function e(e){var t=this;e.map(function(e){if(e.endsWith(".css"))return t.injectHtml.push({attributes:{href:e,rel:"stylesheet"},tagName:"link"});t.injectHtml.push({attributes:{src:e},tagName:"script"})})}},{key:"injectGlobalVal",value:function e(){if(!this.op.empRuntime)return;var e=this.op,t=e.empRuntime,r=this,n=r.injectHtml,i=this.fk.global||(t.shareLib?"window":"");if(!(t.injectGlobalValToHtml===!1||!this.rt.lib)){var a={frameworkLib:i,runtimeLib:this.rt.global};this.fk.name&&this.fk.name!=="none"&&(a.framework=this.fk.name),n.push({tagName:"script",innerHTML:"window.".concat(w,"=").concat(JSON.stringify(a))})}}},{key:"resetFramework",value:function e(){if(!this.op.empRuntime)return;var e=this.op.empRuntime,t=e.framework,r=e.frameworkGlobal,n=e.frameworkLib;this.fk={name:"none",version:0,entry:"",global:r||"",lib:n||"",libs:[]},typeof t=="string"?this.fk.name=t:(typeof t==="undefined"?"undefined":f(t))=="object"&&Object.keys(t).length>0&&(t.entry=t.entry?t.entry:t.name,this.fk=v(this.fk,t))}},{key:"resetRuntime",value:function e(){var e;var t=this.op,r=t.empRuntime;if(!r)return;var n=r.runtimeGlobal||j,i=r.runtimeLib?r.runtimeLib:((e=r.runtime)===null||e===void 0?void 0:e.lib)?r.runtime.lib:"";this.rt={lib:i,global:n}}},{key:"setExternal",value:function e(){var e=this;if(!this.op.empRuntime)return;var t=this,r=t.store,n=t.externalsLib,i=this.op,a=i.empRuntime,o=a.shareLib,u=this.rt.lib?{"@module-federation/runtime":"MFRuntime","@module-federation/sdk":"MFSDK"}:{},s={};var f=true,c=false,m=undefined;try{for(var h=Object.entries(u)[Symbol.iterator](),p;!(f=(p=h.next()).done);f=true){var y=l(p.value,2),b=y[0],d=y[1];s[b]="".concat(this.rt.global,".").concat(d)}}catch(e){c=true;m=e}finally{try{if(!f&&h.return!=null){h.return()}}finally{if(c){throw m}}}if(this.fk.name==="react"&&!o&&this.fk.global){var v=this.fk.version,g={react:"React","react-dom":"ReactDOM"};this.fk.entry==="reactRouter"&&(g["react-router-dom"]="ReactRouterDOM");var k=true,j=false,w=undefined;try{for(var R=Object.entries(g)[Symbol.iterator](),x;!(k=(x=R.next()).done);k=true){var E=l(x.value,2),O=E[0],S=E[1];s[O]="".concat(this.fk.global,".").concat(S)}}catch(e){j=true;w=e}finally{try{if(!k&&R.return!=null){R.return()}}finally{if(j){throw w}}}[17,18,19].includes(v)&&(s["react-dom/client"]=this.fk.global,s["react/jsx-runtime"]=this.fk.global,s["react/jsx-dev-runtime"]=this.fk.global)}o&&n.map(function(t){t.type==="js"&&t.module&&t.global&&(s[t.module]="".concat(e.fk.global,".").concat(t.global))}),a.setExternals&&a.setExternals(s,this.fk.global,this.rt.global),r.chain.merge({externals:s})}},{key:"setRuntimeLib",value:function e(){if(!this.op.empRuntime)return;var e=this.op.empRuntime,t=e.shareLib,r=this,n=r.store,i=r.injectHtml,a=this.op,o=a.empRuntime;this.rt.lib?this.rt.lib==="useFrameworkLib"&&!t||i.push({tagName:"script",pos:"head",attributes:{src:this.rt.lib}}):n.chain.plugin("plugin-emp-share-framework").use(O,[o])}},{key:"setMfName",value:function e(){this.op.name?(this.op.name=this.store.encodeVarName(this.op.name),this.op.name!==this.store.empConfig.output.uniqueName&&this.store.chain.output.set("uniqueName",this.op.name)):this.op.name=this.store.empConfig.output.uniqueName}},{key:"setMF",value:function e(){var e=this.op,t=this,r=t.store;if(e.name){var n;var i=r.deepAssign({filename:"emp.js"},e);i.empRuntime&&delete i.empRuntime,e.forceRemotes&&(S(r,e.forceRemotes),delete e.forceRemotes,(n=i.runtimePlugins)===null||n===void 0?void 0:n.push(y.resolve("@empjs/share/forceRemote"))),r.chain.plugin("plugin-emp-share").use(x,[i])}}},{key:"setShareLib",value:function e(){if(!this.op.empRuntime)return;var e=this.op.empRuntime,t=e.shareLib,r=this,n=r.externalsLib,i=r.injectHtml;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"){var a=true,o=false,u=undefined;try{var s=function(){var e=l(m.value,2),t=e[0],r=e[1];var i={};if(i.module=t,typeof r=="string"){var a=r.match(L)||[];a.length>0?(i.global=a[1],i.entry=a[2],i.type="js",n.push(i),i={}):(i.global="",i.entry=r,i.type="js",n.push(i),i={})}else Array.isArray(r)?r.map(function(e){if(!e)return;if(e.split("?")[0].endsWith(".css"))i.entry=e,i.type="css";else{var t=e.match(L)||[];t.length>0?(i.global=t[1],i.entry=t[2],i.type="js"):(i.global="",i.entry=e,i.type="js")}n.push(i),i={}}):(typeof r==="undefined"?"undefined":f(r))=="object"&&r.entry&&(i.entry=r.entry,i.global=r.global,i.type=r.type,n.push(i),i={})};for(var c=Object.entries(t)[Symbol.iterator](),m;!(a=(m=c.next()).done);a=true)s()}catch(e){o=true;u=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(o){throw u}}}n.map(function(e){e.type==="js"?i.push({attributes:{src:e.entry},tagName:"script"}):e.type==="css"&&i.push({attributes:{href:e.entry,rel:"stylesheet"},tagName:"link"})})}}}]);return e}();var P=function(e,t){return e=Object.assign(e,{react:"".concat(t,".React"),"react-dom":"".concat(t,".ReactDOM"),"react-dom/client":t,"react/jsx-runtime":t,"react/jsx-dev-runtime":t,"react-router-dom":"".concat(t,".ReactRouterDOM")}),e};var _=function(e,t){return e=Object.assign(e,{vue:"".concat(t,".Vue"),"vue-router":"".concat(t,".VueRouter")}),e};var F=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{name:"@empjs/share",rsConfig:function t(t){return n(function(){return m(this,function(r){e.manifest===!0?e.manifest={fileName:"emp.json"}:f(e.manifest)=="object"?e.manifest=t.deepAssign({fileName:"emp.json"},e.manifest):e.exposes&&Object.keys(e.exposes).length>0?e.manifest={fileName:"emp.json"}:e.manifest=!1,new N(e,t).setup();return[2]})})()}}},H=F;export{H as default,P as externalReact,_ as externalVue,F as pluginRspackEmpShare};//# sourceMappingURL=rspack.js.map
|
|
1
|
+
import{createRequire as e}from"module";import{resolve as t}from"path";import{fileURLToPath as i}from"url";import{ModuleFederationPlugin as r}from"@module-federation/rspack";import{deepAssign as s,importJsVm as n}from"./227.js";import{shareForceRemote as o,shareGlobalVal as a,shareGlobalName as l}from"./607.js";function m(t,i){return e(t).resolve(i)}class u{apply(e){let{webpack:t}=e,i=n("import '@empjs/share/library'");new t.EntryPlugin(e.context,i,{name:void 0}).apply(e)}constructor(e){var t,i;i=void 0,(t="options")in this?Object.defineProperty(this,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):this[t]=i,this.options=e}}function h(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),r.forEach(function(t){h(e,t,i[t])})}return e}let f=/^([0-9a-zA-Z_\s]+)@(.*)/,c=["@empjs/share/sdk"];class b{setup(){this.resetRuntime(),this.resetFramework(),this.setMfName(),this.setMF(),this.injectGlobalVal(),this.injectFramework(),this.setShareLib(),this.setRuntimeLib(),this.injectToHtml(),this.setExternal()}injectToHtml(){let{store:e,injectHtml:t}=this;t.length>0&&e.injectTags(t,"EMPShare")}injectFramework(){if(this.fk&&this.fk.libs.length>0)return this.injectFkLibs(this.fk.libs);if(!this.op.empRuntime||!this.fk.lib)return;let{store:e,injectHtml:t}=this;if(this.fk.lib){let i=function(e,t,i="runtime"){if("string"==typeof e)if("runtime"===i)return`${e}/runtime${"development"===t?".development":""}.umd.js`;else return`${e}/${i}.${t}.umd.js`;if("object"==typeof e)if("development"===t)return e.dev;else return e.prod;return""}(this.fk.lib,e.mode,this.fk.entry);t.push({attributes:{src:i},tagName:"script"})}}injectFkLibs(e){e.map(e=>{if(e.endsWith(".css"))return this.injectHtml.push({attributes:{href:e,rel:"stylesheet"},tagName:"link"});this.injectHtml.push({attributes:{src:e},tagName:"script"})})}injectGlobalVal(){if(!this.op.empRuntime)return;let{empRuntime:e}=this.op,{injectHtml:t}=this,i=this.fk.global||(e.shareLib?"window":"");if(!1!==e.injectGlobalValToHtml&&this.rt.lib){let e={frameworkLib:i,runtimeLib:this.rt.global};this.fk.name&&"none"!==this.fk.name&&(e.framework=this.fk.name),t.push({tagName:"script",innerHTML:`window.${a}=${JSON.stringify(e)}`})}}resetFramework(){if(!this.op.empRuntime)return;let{framework:e,frameworkGlobal:t,frameworkLib:i}=this.op.empRuntime;this.fk={name:"none",version:0,entry:"",global:t||"",lib:i||"",libs:[]},"string"==typeof e?this.fk.name=e:"object"==typeof e&&Object.keys(e).length>0&&(e.entry=e.entry?e.entry:e.name,this.fk=s(this.fk,e))}resetRuntime(){var e;let{empRuntime:t}=this.op;if(!t)return;let i=t.runtimeGlobal||l,r=t.runtimeLib?t.runtimeLib:(null==(e=t.runtime)?void 0:e.lib)?t.runtime.lib:"";this.rt={lib:r,global:i}}setExternal(){if(!this.op.empRuntime)return;let{store:e,externalsLib:t}=this,{empRuntime:i}=this.op,{shareLib:r}=i,s=this.rt.lib?{"@module-federation/runtime":"MFRuntime","@module-federation/sdk":"MFSDK"}:{},n={};for(let[e,t]of Object.entries(s))n[e]=`${this.rt.global}.${t}`;if("react"===this.fk.name&&!r&&this.fk.global){let e=this.fk.version,t={react:"React","react-dom":"ReactDOM"};for(let[e,i]of("reactRouter"===this.fk.entry&&(t["react-router-dom"]="ReactRouterDOM"),Object.entries(t)))n[e]=`${this.fk.global}.${i}`;[17,18,19].includes(e)&&(n["react-dom/client"]=this.fk.global,n["react/jsx-runtime"]=this.fk.global,n["react/jsx-dev-runtime"]=this.fk.global)}r&&t.map(e=>{"js"===e.type&&e.module&&e.global&&(n[e.module]=`${this.fk.global}.${e.global}`)}),i.setExternals&&i.setExternals(n,this.fk.global,this.rt.global),e.chain.merge({externals:n})}setRuntimeLib(){if(!this.op.empRuntime)return;let{shareLib:e}=this.op.empRuntime,{store:t,injectHtml:i}=this,{empRuntime:r}=this.op;this.rt.lib?("useFrameworkLib"!==this.rt.lib||e)&&i.push({tagName:"script",pos:"head",attributes:{src:this.rt.lib}}):t.chain.plugin("plugin-emp-share-framework").use(u,[r])}setMfName(){this.op.name?(this.op.name=this.store.encodeVarName(this.op.name),this.op.name!==this.store.empConfig.output.uniqueName&&this.store.chain.output.set("uniqueName",this.op.name)):this.op.name=this.store.empConfig.output.uniqueName}setMF(){let e=this.op,{store:s}=this;if(e.name){this.setDtsRuntimePkgs();let a=s.deepAssign({filename:"emp.js"},e);if(a.empRuntime&&delete a.empRuntime,e.forceRemotes){var n;Object.keys(n=e.forceRemotes).length>0&&s.injectTags([{innerHTML:`window.${o} = ${JSON.stringify(n)};`,tagName:"script",pos:"head"}],"EMP_FORCE_REMOTES"),delete e.forceRemotes,null!=a.runtimePlugins||(a.runtimePlugins=[]),a.runtimePlugins.push(function(e){try{return m(t(process.cwd(),"package.json"),e)}catch(r){let t=function(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error().stack;if(!Array.isArray(e))return;let t=e.map(e=>{var t;return null==(t=e.getFileName)?void 0:t.call(e)}).find(e=>e&&!e.startsWith("node:")&&!e.startsWith("["));if(!t)return;return t.startsWith("file:")?i(t):t}finally{Error.prepareStackTrace=e}}();if(t)return m(t,e);throw r}}("@empjs/share/forceRemote"))}s.chain.plugin("plugin-emp-share").use(r,[a])}}setDtsRuntimePkgs(){if(!this.op.empRuntime||!1===this.op.dts)return;let e=!0===this.op.dts||null==this.op.dts?{}:p({},this.op.dts);if(!1===e.consumeTypes){this.op.dts=e;return}let t=!0===e.consumeTypes||null==e.consumeTypes?{}:p({},e.consumeTypes);t.runtimePkgs=function(e=[]){return Array.from(new Set([...c,...e]))}(t.runtimePkgs),e.consumeTypes=t,this.op.dts=e}setShareLib(){if(!this.op.empRuntime)return;let{shareLib:e}=this.op.empRuntime,{externalsLib:t,injectHtml:i}=this;if(e&&"object"==typeof e){for(let[i,r]of Object.entries(e)){let e={};if(e.module=i,"string"==typeof r){let i=r.match(f)||[];i.length>0?(e.global=i[1],e.entry=i[2]):(e.global="",e.entry=r),e.type="js",t.push(e),e={}}else Array.isArray(r)?r.map(i=>{if(i){if(i.split("?")[0].endsWith(".css"))e.entry=i,e.type="css";else{let t=i.match(f)||[];t.length>0?(e.global=t[1],e.entry=t[2]):(e.global="",e.entry=i),e.type="js"}t.push(e),e={}}}):"object"==typeof r&&r.entry&&(e.entry=r.entry,e.global=r.global,e.type=r.type,t.push(e),e={})}t.map(e=>{"js"===e.type?i.push({attributes:{src:e.entry},tagName:"script"}):"css"===e.type&&i.push({attributes:{href:e.entry,rel:"stylesheet"},tagName:"link"})})}}constructor(e,t){h(this,"op",void 0),h(this,"store",void 0),h(this,"injectHtml",[]),h(this,"externalsLib",[]),h(this,"fk",void 0),h(this,"rt",void 0),this.op=e||{},this.store=t}}function g(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){i(e);return}a.done?t(l):Promise.resolve(l).then(r,s)}let y=(e={})=>({name:"@empjs/share",rsConfig:t=>{var i;return(i=function*(){!0===e.manifest?e.manifest={fileName:"emp.json"}:"object"==typeof e.manifest&&(e.manifest=t.deepAssign({fileName:"emp.json"},e.manifest)),new b(e,t).setup()},function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(e){g(n,r,s,o,a,"next",e)}function a(e){g(n,r,s,o,a,"throw",e)}o(void 0)})})()}});export{externalReact}from"./171.js";export{externalVue}from"./68.js";export default y;export{y as pluginRspackEmpShare};
|
|
2
|
+
//# sourceMappingURL=rspack.js.map
|
package/dist/rspack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/liangxiaoming/Documents/emp/packages/emp-share/dist/rspack.js","../src/helper/index.ts","../src/helper/config.ts","../src/helper/rspack.ts","../src/plugins/rspack/plugin.ts","../src/plugins/rspack/runtimePlugin/registerRemotes.ts","../src/plugins/rspack/utils.ts","../src/plugins/rspack/share.ts","../src/framework/react/config.ts","../src/framework/vue/config.ts","../src/plugins/rspack/index.ts"],"names":["S","Object","defineProperty","M","t","e","i","enumerable","configurable","writable","value","h","require","Proxy","get","apply","arguments","Error","m","importJsVm","content","deepAssign","target","sources","source","k","vs","vt","isDev","log","console","bind","shareGlobalName","shareGlobalVal","shareForceRemote","ModuleFederationPlugin","getShareRuntimeEntry","url","join","EmpShareRemoteLibPlugin","op","__publicField","options","compiler","webpack","entry","EntryPlugin","context","name","registerRemotes","store","forceRemotes","keys","length","injectTags","innerHTML","JSON","stringify","tagName","pos","getRuntimeLib","host","mode","dev","prod","exp","EmpShare","setup","resetRuntime","resetFramework","setMfName","setMF","injectGlobalVal","injectFramework","setShareLib","setRuntimeLib","injectToHtml","setExternal","injectHtml","fk","libs","injectFkLibs","empRuntime","lib","push","attributes","src","map","endsWith","href","rel","frameworkGlobal","global","shareLib","injectGlobalValToHtml","rt","injectData","frameworkLib","runtimeLib","framework","version","runtimeGlobal","runtime","externalsLib","externalRuntime","externals","entries","key","externalReact","react","includes","v","type","module","setExternals","chain","merge","plugin","use","encodeVarName","empConfig","output","uniqueName","set","o","filename","runtimePlugins","__require","resolve","externalsItem","cb","match","Array","isArray","vo","split","globalVal","assign","externalVue","vue","pluginRspackEmpShare","rsConfig","manifest","fileName","exposes","rspack_default"],"mappings":"o6FAAA,IAAIA,EAAEC,OAAOC,cAAc,CAAC,IAAIC,EAAE,SAACC,EAAEC,EAAEC,UAAID,KAAKD,EAAEJ,EAAEI,EAAEC,EAAE,CAACE,WAAW,CAAC,EAAEC,aAAa,CAAC,EAAEC,SAAS,CAAC,EAAEC,MAAMJ,CAAC,GAAGF,CAAC,CAACC,EAAE,CAACC,GAAE,IAAIK,EAAE,AAACP,SAAAA,SAAG,CAAA,OAAOQ,kCAAP,EAAOA,QAAM,EAAE,IAAIA,QAAQ,CAAA,OAAOC,gCAAP,EAAOA,MAAI,EAAE,IAAI,IAAIA,MAAMT,EAAE,CAACU,IAAI,SAACT,EAAEC,SAAI,AAAC,CAAA,CAAA,OAAOM,kCAAP,EAAOA,QAAM,EAAE,IAAIA,QAAQP,CAAAA,CAAE,CAACC,EAAE,CAAA,GAAGF,GAAG,SAASA,CAAC,EAAE,GAAG,CAAA,OAAOQ,kCAAP,EAAOA,QAAM,EAAE,IAAI,OAAOA,QAAQG,KAAK,CAAC,IAAI,CAACC,UAAW,OAAMC,MAAM,uBAAuBb,EAAE,qBAAqB,GAAG,IAAIc,EAAE,SAACd,EAAEC,EAAEC,UAAIH,EAAEC,EAAE,CAAA,OAAOC,4BAAP,EAAOA,EAAAA,GAAG,SAASA,EAAE,GAAGA,EAAEC,ICAnZ,IAAMa,EAAcC,SAAAA,SAAoB,wBAA+B,OAAPA,IAEhE,SAASC,EAAcC,CAAAA,EAAAA,IAAAA,IAAAA,EAAAA,UAAAA,OAAAA,AAAgBC,EAAhBD,UAAAA,EAAAA,EAAAA,EAAAA,KAAAA,EAAAA,EAAAA,EAAAA,EAAAA,KAAgBC,EAAhBD,EAAAA,GAAAA,SAAAA,CAAAA,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AMsB,EAAElE,KAAA,CACR6C,IAAK,YACP,EACAhC,QAAS,MACX,EAEJ,EACF,CACF,iBCjUK,IAAMkD,EAAgB,SAACgB,EAAQY,UACpCZ,EAAI3H,OAAOwI,MAAA,CAAOb,EAAG,CACnBf,MAAO,GAAY,OAAT2B,EAAS,UACnB,YAAa,GAAY,OAATA,EAAS,aACzB,mBAAoBA,EACpB,oBAAqBA,EACrB,wBAAyBA,EACzB,mBAAoB,GAAY,OAATA,EAAS,kBAClC,GACOZ,GCTF,IAAMc,EAAc,SAACd,EAAQY,UAClCZ,EAAI3H,OAAOwI,MAAA,CAAOb,EAAG,CACnBe,IAAK,GAAY,OAATH,EAAS,QACjB,aAAc,GAAY,OAATA,EAAS,aAC5B,GACOZ,GCIF,IAAMgB,EAAuB,eAAChB,yDAAwB,CAAC,QACrD,CACL5E,KAAM,eACA6F,SAAN,SAAMA,EAAS3F,CAAAA,gDAET0E,EAAEkB,QAAA,GAAa,CAAA,EACjBlB,EAAEkB,QAAA,CAAW,CACXC,SAAU,UACZ,EACS,EAAOnB,EAAEkB,QAAA,GAAa,SAC/BlB,EAAEkB,QAAA,CAAW5F,EAAM7B,UAAA,CAAW,CAAC0H,SAAU,UAAU,EAAGnB,EAAEkB,QAAQ,EAG7ClB,EAAEoB,OAAA,EAAW/I,OAAOmD,IAAA,CAAKwE,EAAEoB,OAAO,EAAE3F,MAAA,CAAS,EAE9DuE,EAAEkB,QAAA,CAAW,CACXC,SAAU,UACZ,EAEAnB,EAAEkB,QAAA,CAAW,CAAA,EAGA,IAAI5E,EAAS0D,EAAG1E,GACxBiB,KAAA,cACX,KACF,GAEK8E,EAAQL,SAAAA,KAAAA,OAAAA,CAAAA,KAAAA,aAAAA,CAAAA,KAAAA,WAAAA,CAAAA,KAAAA,oBAAAA","sourcesContent":["var S=Object.defineProperty;var M=(t,e,i)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var h=(t=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(t,{get:(e,i)=>(typeof require<\"u\"?require:e)[i]}):t)(function(t){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+t+'\" is not supported')});var m=(t,e,i)=>M(t,typeof e!=\"symbol\"?e+\"\":e,i);var b=t=>`data:text/javascript,${t}`;function f(t,...e){for(let i of e)for(let r in i){let a=i[r],n=t[r];if(Object(a)==a&&Object(n)===n){t[r]=f(n,a);continue}t[r]=i[r]}return t}var O=!1,v=O?console.log.bind(console,\"[EMP Share]\"):()=>{};var y=\"EMP_SHARE_RUNTIME\",g=\"EMPShareGlobalVal\",R=\"EMP_FORCE_REMOTES\";import{ModuleFederationPlugin as j}from\"@empjs/module-federation-rspack\";var P=t=>{let e=[`import '${t}'`].join(`\n`);return b(e)},c=class{constructor(e){m(this,\"options\");this.options=e}apply(e){let{webpack:i}=e,r=P(\"@empjs/share/library\");new i.EntryPlugin(e.context,r,{name:void 0}).apply(e)}};var k=(t,e)=>{Object.keys(e).length>0&&t.injectTags([{innerHTML:`window.${R} = ${JSON.stringify(e)};`,tagName:\"script\",pos:\"head\"}],\"EMP_FORCE_REMOTES\")};function d(t,e,i=\"runtime\"){return typeof t==\"string\"?i===\"runtime\"?`${t}/runtime${e===\"development\"?\".development\":\"\"}.umd.js`:`${t}/${i}.${e}.umd.js`:typeof t==\"object\"?e===\"development\"?t.dev:t.prod:\"\"}var x=/^([0-9a-zA-Z_\\s]+)@(.*)/,u=class{constructor(e,i){m(this,\"op\");m(this,\"store\");m(this,\"injectHtml\",[]);m(this,\"externalsLib\",[]);m(this,\"fk\");m(this,\"rt\");this.op=e||{},this.store=i}setup(){this.resetRuntime(),this.resetFramework(),this.setMfName(),this.setMF(),this.injectGlobalVal(),this.injectFramework(),this.setShareLib(),this.setRuntimeLib(),this.injectToHtml(),this.setExternal()}injectToHtml(){let{store:e,injectHtml:i}=this;i.length>0&&e.injectTags(i,\"EMPShare\")}injectFramework(){if(this.fk&&this.fk.libs.length>0)return this.injectFkLibs(this.fk.libs);if(!this.op.empRuntime||!this.fk.lib)return;let{store:e,injectHtml:i}=this;if(this.fk.lib){let r=d(this.fk.lib,e.mode,this.fk.entry);i.push({attributes:{src:r},tagName:\"script\"})}}injectFkLibs(e){e.map(i=>{if(i.endsWith(\".css\"))return this.injectHtml.push({attributes:{href:i,rel:\"stylesheet\"},tagName:\"link\"});this.injectHtml.push({attributes:{src:i},tagName:\"script\"})})}injectGlobalVal(){if(!this.op.empRuntime)return;let{empRuntime:e}=this.op,{injectHtml:i}=this,r=this.fk.global||(e.shareLib?\"window\":\"\");if(!(e.injectGlobalValToHtml===!1||!this.rt.lib)){let n={frameworkLib:r,runtimeLib:this.rt.global};this.fk.name&&this.fk.name!==\"none\"&&(n.framework=this.fk.name),i.push({tagName:\"script\",innerHTML:`window.${g}=${JSON.stringify(n)}`})}}resetFramework(){if(!this.op.empRuntime)return;let{framework:e,frameworkGlobal:i,frameworkLib:r}=this.op.empRuntime;this.fk={name:\"none\",version:0,entry:\"\",global:i||\"\",lib:r||\"\",libs:[]},typeof e==\"string\"?this.fk.name=e:typeof e==\"object\"&&Object.keys(e).length>0&&(e.entry=e.entry?e.entry:e.name,this.fk=f(this.fk,e))}resetRuntime(){let{empRuntime:e}=this.op;if(!e)return;let i=e.runtimeGlobal||y,r=e.runtimeLib?e.runtimeLib:e.runtime?.lib?e.runtime.lib:\"\";this.rt={lib:r,global:i}}setExternal(){if(!this.op.empRuntime)return;let{store:e,externalsLib:i}=this,{empRuntime:r}=this.op,{shareLib:a}=r,n=this.rt.lib?{\"@module-federation/runtime\":\"MFRuntime\",\"@module-federation/sdk\":\"MFSDK\"}:{},s={};for(let[o,p]of Object.entries(n))s[o]=`${this.rt.global}.${p}`;if(this.fk.name===\"react\"&&!a&&this.fk.global){let o=this.fk.version,p={react:\"React\",\"react-dom\":\"ReactDOM\"};this.fk.entry===\"reactRouter\"&&(p[\"react-router-dom\"]=\"ReactRouterDOM\");for(let[l,E]of Object.entries(p))s[l]=`${this.fk.global}.${E}`;[17,18,19].includes(o)&&(s[\"react-dom/client\"]=this.fk.global,s[\"react/jsx-runtime\"]=this.fk.global,s[\"react/jsx-dev-runtime\"]=this.fk.global)}a&&i.map(o=>{o.type===\"js\"&&o.module&&o.global&&(s[o.module]=`${this.fk.global}.${o.global}`)}),r.setExternals&&r.setExternals(s,this.fk.global,this.rt.global),e.chain.merge({externals:s})}setRuntimeLib(){if(!this.op.empRuntime)return;let{shareLib:e}=this.op.empRuntime,{store:i,injectHtml:r}=this,{empRuntime:a}=this.op;this.rt.lib?this.rt.lib===\"useFrameworkLib\"&&!e||r.push({tagName:\"script\",pos:\"head\",attributes:{src:this.rt.lib}}):i.chain.plugin(\"plugin-emp-share-framework\").use(c,[a])}setMfName(){this.op.name?(this.op.name=this.store.encodeVarName(this.op.name),this.op.name!==this.store.empConfig.output.uniqueName&&this.store.chain.output.set(\"uniqueName\",this.op.name)):this.op.name=this.store.empConfig.output.uniqueName}setMF(){let e=this.op,{store:i}=this;if(e.name){let r=i.deepAssign({filename:\"emp.js\"},e);r.empRuntime&&delete r.empRuntime,e.forceRemotes&&(k(i,e.forceRemotes),delete e.forceRemotes,r.runtimePlugins?.push(h.resolve(\"@empjs/share/forceRemote\"))),i.chain.plugin(\"plugin-emp-share\").use(j,[r])}}setShareLib(){if(!this.op.empRuntime)return;let{shareLib:e}=this.op.empRuntime,{externalsLib:i,injectHtml:r}=this;if(e&&typeof e==\"object\"){for(let[a,n]of Object.entries(e)){let s={};if(s.module=a,typeof n==\"string\"){let o=n.match(x)||[];o.length>0?(s.global=o[1],s.entry=o[2],s.type=\"js\",i.push(s),s={}):(s.global=\"\",s.entry=n,s.type=\"js\",i.push(s),s={})}else Array.isArray(n)?n.map(o=>{if(!o)return;if(o.split(\"?\")[0].endsWith(\".css\"))s.entry=o,s.type=\"css\";else{let l=o.match(x)||[];l.length>0?(s.global=l[1],s.entry=l[2],s.type=\"js\"):(s.global=\"\",s.entry=o,s.type=\"js\")}i.push(s),s={}}):typeof n==\"object\"&&n.entry&&(s.entry=n.entry,s.global=n.global,s.type=n.type,i.push(s),s={})}i.map(a=>{a.type===\"js\"?r.push({attributes:{src:a.entry},tagName:\"script\"}):a.type===\"css\"&&r.push({attributes:{href:a.entry,rel:\"stylesheet\"},tagName:\"link\"})})}}};var Z=(t,e)=>(t=Object.assign(t,{react:`${e}.React`,\"react-dom\":`${e}.ReactDOM`,\"react-dom/client\":e,\"react/jsx-runtime\":e,\"react/jsx-dev-runtime\":e,\"react-router-dom\":`${e}.ReactRouterDOM`}),t);var Q=(t,e)=>(t=Object.assign(t,{vue:`${e}.Vue`,\"vue-router\":`${e}.VueRouter`}),t);var L=(t={})=>({name:\"@empjs/share\",async rsConfig(e){t.manifest===!0?t.manifest={fileName:\"emp.json\"}:typeof t.manifest==\"object\"?t.manifest=e.deepAssign({fileName:\"emp.json\"},t.manifest):t.exposes&&Object.keys(t.exposes).length>0?t.manifest={fileName:\"emp.json\"}:t.manifest=!1,new u(t,e).setup()}}),ee=L;export{ee as default,Z as externalReact,Q as externalVue,L as pluginRspackEmpShare};\n","export const importJsVm = (content: string) => `data:text/javascript,${content}`\n\nexport function deepAssign<T>(target: any, ...sources: any): T {\n for (const source of sources) {\n for (const k in source) {\n const vs = source[k],\n vt = target[k]\n if (Object(vs) == vs && Object(vt) === vt) {\n target[k] = deepAssign(vt, vs)\n continue\n }\n target[k] = source[k]\n }\n }\n return target\n}\n\nexport const checkVersion = (version: string) => (version ? Number(version.split('.')[0]) : 0)\nexport const isPromise = (p: any) => p && Object.prototype.toString.call(p) === '[object Promise]'\n\n//\nexport const isDev = process.env.EMPSHARE_ENV === 'dev'\nexport const log = isDev ? console.log.bind(console, '[EMP Share]') : () => {}\n","export const shareGlobalName = 'EMP_SHARE_RUNTIME'\nexport const shareGlobalVal = 'EMPShareGlobalVal'\nexport const shareForceRemote = 'EMP_FORCE_REMOTES'\n","// export {ModuleFederationPlugin} from '@module-federation/rspack'\nexport {ModuleFederationPlugin} from '@empjs/module-federation-rspack'\n","import {Compiler} from '@empjs/cli'\nimport {importJsVm} from 'src/helper'\nimport type {EMPSHARERuntimeOptions} from './types'\n\nconst getShareRuntimeEntry = url => {\n const content = [`import '${url}'`].join('\\n')\n return importJsVm(content)\n}\n// 当没有设置 runtimeLib 时候需要内置\nexport class EmpShareRemoteLibPlugin {\n options: EMPSHARERuntimeOptions\n constructor(op: EMPSHARERuntimeOptions) {\n this.options = op\n }\n apply(compiler: Compiler) {\n const {webpack} = compiler\n const entry = getShareRuntimeEntry('@empjs/share/library')\n new webpack.EntryPlugin(compiler.context, entry, {\n name: undefined,\n }).apply(compiler)\n }\n}\n","import {type GlobalStore} from '@empjs/cli'\nimport {shareForceRemote} from 'src/helper/config'\nimport {ForceRemoteOptions} from '../types'\n\nexport const registerRemotes = (store: GlobalStore, forceRemotes: ForceRemoteOptions) => {\n if (Object.keys(forceRemotes).length > 0) {\n store.injectTags(\n [\n {\n innerHTML: `window.${shareForceRemote} = ${JSON.stringify(forceRemotes)};`,\n tagName: 'script',\n pos: 'head',\n },\n ],\n 'EMP_FORCE_REMOTES',\n )\n }\n}\n","import type {EMPSHARERuntimeOptions} from './types'\nexport function getRuntimeLib(host: EMPSHARERuntimeOptions['frameworkLib'], mode: string, entry = 'runtime') {\n if (typeof host === 'string') {\n if (entry === 'runtime') {\n return `${host}/runtime${mode === 'development' ? '.development' : ''}.umd.js`\n } else {\n return `${host}/${entry}.${mode}.umd.js`\n }\n } else if (typeof host === 'object') {\n if (mode === 'development') return host.dev\n else return host.prod\n }\n return ''\n}\n","import type {GlobalStore} from '@empjs/cli'\nimport {deepAssign} from 'src/helper'\nimport {shareGlobalName, shareGlobalVal} from 'src/helper/config'\nimport {ModuleFederationPlugin} from 'src/helper/rspack'\nimport {EmpShareRemoteLibPlugin} from './plugin'\nimport {registerRemotes} from './runtimePlugin/registerRemotes'\nimport type {\n EMPPluginShareType,\n ExternalsItemType,\n frameworkOptions,\n ModuleFederationPluginOptions,\n runtimeLibType,\n} from './types'\nimport {getRuntimeLib} from './utils'\n\nconst exp = /^([0-9a-zA-Z_\\s]+)@(.*)/\nexport class EmpShare {\n private op: EMPPluginShareType\n private store: GlobalStore\n /**\n * 注入资源\n */\n private injectHtml: any[] = []\n /**\n * 兼容 shareLib\n */\n private externalsLib: ExternalsItemType[] = []\n constructor(op: EMPPluginShareType, store: GlobalStore) {\n this.op = op || {}\n this.store = store\n }\n setup() {\n this.resetRuntime()\n this.resetFramework()\n this.setMfName() //设置 mfName 默认为 uniqueName\n this.setMF() // 设置 MF 配置\n this.injectGlobalVal() // 插入全局变量 方便emp外的项目调用\n this.injectFramework() // 插入ui框架库\n this.setShareLib() //兼容 emp Sharelib的共享模型设置\n this.setRuntimeLib() // 设置 MF SDK\n this.injectToHtml() //触发插入动作\n this.setExternal() // 设置 external 降低包体\n }\n private injectToHtml() {\n const {store, injectHtml} = this\n if (injectHtml.length > 0) {\n store.injectTags(injectHtml, 'EMPShare')\n }\n }\n private injectFramework() {\n if (this.fk && this.fk.libs.length > 0) {\n return this.injectFkLibs(this.fk.libs)\n }\n if (!this.op.empRuntime || !this.fk.lib) return\n const {store, injectHtml} = this\n if (this.fk.lib) {\n const url = getRuntimeLib(this.fk.lib, store.mode, this.fk.entry)\n injectHtml.push({\n attributes: {\n src: url,\n },\n tagName: 'script',\n })\n }\n }\n private injectFkLibs(libs: string[]) {\n libs.map(url => {\n if (url.endsWith('.css')) {\n return this.injectHtml.push({\n attributes: {\n href: url,\n rel: 'stylesheet',\n },\n tagName: 'link',\n })\n }\n this.injectHtml.push({\n attributes: {\n src: url,\n },\n tagName: 'script',\n })\n })\n }\n private injectGlobalVal() {\n if (!this.op.empRuntime) return\n const {empRuntime} = this.op\n const {injectHtml} = this\n const frameworkGlobal = this.fk.global || (empRuntime.shareLib ? 'window' : '')\n const injectGlobalValToHtml = empRuntime.injectGlobalValToHtml === false || !this.rt.lib ? false : true\n // 插入全局引用变量 让 empRuntime 可以提前实例化 不需要在页面重复实例化\n if (injectGlobalValToHtml) {\n const injectData: any = {frameworkLib: frameworkGlobal, runtimeLib: this.rt.global}\n if (this.fk.name && this.fk.name !== 'none') injectData.framework = this.fk.name\n injectHtml.push({\n // type: 'js',\n tagName: 'script',\n innerHTML: `window.${shareGlobalVal}=${JSON.stringify(injectData)}`,\n })\n }\n }\n public fk!: Required<frameworkOptions>\n private resetFramework() {\n if (!this.op.empRuntime) return\n const {framework, frameworkGlobal, frameworkLib} = this.op.empRuntime\n //\n this.fk = {\n name: 'none',\n version: 0,\n entry: '',\n global: frameworkGlobal || '',\n lib: frameworkLib || '',\n libs: [],\n }\n //\n if (typeof framework === 'string') {\n this.fk.name = framework as any\n }\n // TODO 通用 CDN 的适配方案\n else if (typeof framework === 'object' && Object.keys(framework).length > 0) {\n // 默认 框架名 为入口\n framework.entry = framework.entry ? framework.entry : framework.name\n this.fk = deepAssign(this.fk, framework)\n }\n }\n public rt!: Required<runtimeLibType>\n private resetRuntime() {\n const {empRuntime} = this.op\n if (!empRuntime) return\n const global = empRuntime.runtimeGlobal || shareGlobalName\n const lib = empRuntime.runtimeLib ? empRuntime.runtimeLib : empRuntime.runtime?.lib ? empRuntime.runtime.lib : ''\n this.rt = {\n lib,\n global,\n }\n }\n private setExternal() {\n if (!this.op.empRuntime) return\n const {store, externalsLib} = this\n const {empRuntime} = this.op\n const {shareLib} = empRuntime\n //\n const externalRuntime = this.rt.lib\n ? {\n '@module-federation/runtime': `MFRuntime`,\n '@module-federation/sdk': `MFSDK`,\n }\n : {}\n const externals = {}\n for (const [key, value] of Object.entries(externalRuntime)) {\n externals[key] = `${this.rt.global}.${value}`\n }\n /**\n * TODO\n * 框架相关内容需要移除 share 由外部简化配置实现\n */\n if (this.fk.name === 'react' && !shareLib && this.fk.global) {\n const version = this.fk.version\n const externalReact = {\n react: `React`,\n 'react-dom': `ReactDOM`,\n }\n if (this.fk.entry === 'reactRouter') {\n externalReact['react-router-dom'] = 'ReactRouterDOM'\n }\n for (const [key, value] of Object.entries(externalReact)) {\n externals[key] = `${this.fk.global}.${value}`\n }\n if ([17, 18, 19].includes(version)) {\n externals['react-dom/client'] = this.fk.global\n externals['react/jsx-runtime'] = this.fk.global\n externals['react/jsx-dev-runtime'] = this.fk.global\n }\n }\n if (shareLib) {\n externalsLib.map(v => {\n if (v.type === 'js' && v.module && v.global) {\n externals[v.module] = `${this.fk.global}.${v.global}`\n }\n })\n }\n if (empRuntime.setExternals) empRuntime.setExternals(externals, this.fk.global, this.rt.global)\n //\n // console.log('externals in plugin', externals)\n store.chain.merge({externals})\n }\n private setRuntimeLib() {\n if (!this.op.empRuntime) return\n\n const {shareLib} = this.op.empRuntime\n const {store, injectHtml} = this\n const {empRuntime} = this.op\n if (!this.rt.lib) {\n // 内置 this.rt.lib\n store.chain.plugin('plugin-emp-share-framework').use(EmpShareRemoteLibPlugin, [empRuntime])\n }\n // 统一封装到 frameworkLib\n else if (this.rt.lib === 'useFrameworkLib' && !shareLib) {\n } else {\n // 插入 runtime\n injectHtml.push({tagName: 'script', pos: 'head', attributes: {src: this.rt.lib}})\n }\n }\n private setMfName() {\n if (this.op.name) {\n this.op.name = this.store.encodeVarName(this.op.name)\n if (this.op.name !== this.store.empConfig.output.uniqueName) {\n this.store.chain.output.set('uniqueName', this.op.name)\n }\n } else {\n this.op.name = this.store.empConfig.output.uniqueName\n }\n }\n private setMF() {\n const o = this.op\n const {store} = this\n if (o.name) {\n const op = store.deepAssign<ModuleFederationPluginOptions & {empRuntime: any}>(\n {\n filename: 'emp.js',\n // manifest: false,\n // dts: false,\n // dev: {\n // disableDynamicRemoteTypeHints: true,\n // },\n },\n o,\n )\n //\n // if (o.dev === false) op.dev = false\n //\n if (op.empRuntime) {\n delete op.empRuntime\n }\n /**\n * 注册 forceRemotes\n */\n if (o.forceRemotes) {\n registerRemotes(store, o.forceRemotes)\n delete o.forceRemotes\n op.runtimePlugins?.push(require.resolve('@empjs/share/forceRemote'))\n }\n // console.log('op', op)\n store.chain.plugin('plugin-emp-share').use(ModuleFederationPlugin, [op])\n }\n }\n private setShareLib() {\n if (!this.op.empRuntime) return\n const {shareLib} = this.op.empRuntime\n const {externalsLib, injectHtml} = this\n if (shareLib && typeof shareLib === 'object') {\n for (const [k, v] of Object.entries(shareLib)) {\n let externalsItem: ExternalsItemType = {}\n externalsItem.module = k\n //增加下划线 支持lodash 等特殊符号的问题 如 _@http\n\n if (typeof v === 'string') {\n const cb: any = v.match(exp) || []\n if (cb.length > 0) {\n externalsItem.global = cb[1]\n externalsItem.entry = cb[2]\n externalsItem.type = 'js'\n externalsLib.push(externalsItem)\n externalsItem = {}\n } else {\n externalsItem.global = ''\n externalsItem.entry = v\n externalsItem.type = 'js'\n externalsLib.push(externalsItem)\n externalsItem = {}\n }\n } else if (Array.isArray(v)) {\n v.map(vo => {\n if (!vo) return\n const isCSS = vo.split('?')[0].endsWith('.css')\n if (isCSS) {\n externalsItem.entry = vo\n externalsItem.type = 'css'\n } else {\n const cb: any = vo.match(exp) || []\n if (cb.length > 0) {\n externalsItem.global = cb[1]\n externalsItem.entry = cb[2]\n externalsItem.type = 'js'\n } else {\n externalsItem.global = ''\n externalsItem.entry = vo\n externalsItem.type = 'js'\n }\n }\n externalsLib.push(externalsItem)\n externalsItem = {}\n })\n } else if (typeof v === 'object' && v.entry) {\n externalsItem.entry = v.entry\n externalsItem.global = v.global\n externalsItem.type = v.type\n externalsLib.push(externalsItem)\n externalsItem = {}\n }\n }\n // console.log(externalsLib)\n externalsLib.map(v => {\n if (v.type === 'js') {\n injectHtml.push({\n attributes: {\n src: v.entry,\n },\n tagName: 'script',\n })\n } else if (v.type === 'css') {\n injectHtml.push({\n attributes: {\n href: v.entry,\n rel: 'stylesheet',\n },\n tagName: 'link',\n })\n }\n })\n }\n }\n}\n","export const externalReact = (o: any, globalVal: string) => {\n o = Object.assign(o, {\n react: `${globalVal}.React`,\n 'react-dom': `${globalVal}.ReactDOM`,\n 'react-dom/client': globalVal,\n 'react/jsx-runtime': globalVal,\n 'react/jsx-dev-runtime': globalVal,\n 'react-router-dom': `${globalVal}.ReactRouterDOM`,\n })\n return o\n}\n","export const externalVue = (o: any, globalVal: string) => {\n o = Object.assign(o, {\n vue: `${globalVal}.Vue`,\n 'vue-router': `${globalVal}.VueRouter`,\n })\n return o\n}\n","import type {GlobalStore} from '@empjs/cli'\nimport {EmpShare} from './share'\nimport type {EMPPluginShareType} from './types'\nexport type {EMPPluginShareType}\n//\nexport * from 'src/framework/react/config'\nexport * from 'src/framework/vue/config'\nexport * from './types'\n//\nexport const pluginRspackEmpShare = (o: EMPPluginShareType = {}) => {\n return {\n name: '@empjs/share',\n async rsConfig(store: GlobalStore) {\n //\n if (o.manifest === true) {\n o.manifest = {\n fileName: 'emp.json',\n }\n } else if (typeof o.manifest === 'object') {\n o.manifest = store.deepAssign({fileName: 'emp.json'}, o.manifest)\n } else {\n // 默认情况下,如果 exposes 为空则不生成 manifest 避免冲突\n const hasExposes = o.exposes && Object.keys(o.exposes).length > 0\n if (hasExposes) {\n o.manifest = {\n fileName: 'emp.json',\n }\n } else {\n o.manifest = false\n }\n }\n const empShare = new EmpShare(o, store)\n empShare.setup()\n },\n }\n}\nexport default pluginRspackEmpShare\n"]}
|
|
1
|
+
{"version":3,"file":"rspack.js","sources":["../src/helper/resolvePackageExport.ts","../src/plugins/rspack/plugin.ts","../src/plugins/rspack/share.ts","../src/plugins/rspack/utils.ts","../src/plugins/rspack/runtimePlugin/registerRemotes.ts","../src/plugins/rspack/index.ts"],"sourcesContent":["import {createRequire} from 'node:module'\nimport {resolve} from 'node:path'\nimport {fileURLToPath} from 'node:url'\n\nfunction getCurrentModuleFile(): string | undefined {\n const prepareStackTrace = Error.prepareStackTrace\n try {\n Error.prepareStackTrace = (_error, stack) => stack\n const stack = new Error().stack as unknown\n if (!Array.isArray(stack)) return\n\n const file = stack\n .map(callSite => callSite.getFileName?.())\n .find(fileName => fileName && !fileName.startsWith('node:') && !fileName.startsWith('['))\n\n if (!file) return\n return file.startsWith('file:') ? fileURLToPath(file) : file\n } finally {\n Error.prepareStackTrace = prepareStackTrace\n }\n}\n\nfunction resolveFrom(baseFile: string, specifier: string): string {\n return createRequire(baseFile).resolve(specifier)\n}\n\nexport function resolvePackageExport(specifier: string): string {\n try {\n return resolveFrom(resolve(process.cwd(), 'package.json'), specifier)\n } catch (error) {\n const currentModuleFile = getCurrentModuleFile()\n if (currentModuleFile) return resolveFrom(currentModuleFile, specifier)\n throw error\n }\n}\n","import {Compiler} from '@empjs/cli'\nimport {importJsVm} from 'src/helper'\nimport type {EMPSHARERuntimeOptions} from './types'\n\nconst getShareRuntimeEntry = url => {\n const content = [`import '${url}'`].join('\\n')\n return importJsVm(content)\n}\n// 当没有设置 runtimeLib 时候需要内置\nexport class EmpShareRemoteLibPlugin {\n options: EMPSHARERuntimeOptions\n constructor(op: EMPSHARERuntimeOptions) {\n this.options = op\n }\n apply(compiler: Compiler) {\n const {webpack} = compiler\n const entry = getShareRuntimeEntry('@empjs/share/library')\n new webpack.EntryPlugin(compiler.context, entry, {\n name: undefined,\n }).apply(compiler)\n }\n}\n","import type {GlobalStore} from '@empjs/cli'\nimport {deepAssign} from 'src/helper'\nimport {shareGlobalName, shareGlobalVal} from 'src/helper/config'\nimport {resolvePackageExport} from 'src/helper/resolvePackageExport'\nimport {ModuleFederationPlugin} from 'src/helper/rspack'\nimport {EmpShareRemoteLibPlugin} from './plugin'\nimport {registerRemotes} from './runtimePlugin/registerRemotes'\nimport type {\n EMPPluginShareType,\n ExternalsItemType,\n frameworkOptions,\n ModuleFederationPluginOptions,\n runtimeLibType,\n} from './types'\nimport {getRuntimeLib} from './utils'\n\nconst exp = /^([0-9a-zA-Z_\\s]+)@(.*)/\nconst empShareRuntimeTypePkgs = ['@empjs/share/sdk']\n\nfunction mergeRuntimeTypePkgs(runtimePkgs: string[] = []) {\n return Array.from(new Set([...empShareRuntimeTypePkgs, ...runtimePkgs]))\n}\n\nexport class EmpShare {\n private op: EMPPluginShareType\n private store: GlobalStore\n /**\n * 注入资源\n */\n private injectHtml: any[] = []\n /**\n * 兼容 shareLib\n */\n private externalsLib: ExternalsItemType[] = []\n constructor(op: EMPPluginShareType, store: GlobalStore) {\n this.op = op || {}\n this.store = store\n }\n setup() {\n this.resetRuntime()\n this.resetFramework()\n this.setMfName() //设置 mfName 默认为 uniqueName\n this.setMF() // 设置 MF 配置\n this.injectGlobalVal() // 插入全局变量 方便emp外的项目调用\n this.injectFramework() // 插入ui框架库\n this.setShareLib() //兼容 emp Sharelib的共享模型设置\n this.setRuntimeLib() // 设置 MF SDK\n this.injectToHtml() //触发插入动作\n this.setExternal() // 设置 external 降低包体\n }\n private injectToHtml() {\n const {store, injectHtml} = this\n if (injectHtml.length > 0) {\n store.injectTags(injectHtml, 'EMPShare')\n }\n }\n private injectFramework() {\n if (this.fk && this.fk.libs.length > 0) {\n return this.injectFkLibs(this.fk.libs)\n }\n if (!this.op.empRuntime || !this.fk.lib) return\n const {store, injectHtml} = this\n if (this.fk.lib) {\n const url = getRuntimeLib(this.fk.lib, store.mode, this.fk.entry)\n injectHtml.push({\n attributes: {\n src: url,\n },\n tagName: 'script',\n })\n }\n }\n private injectFkLibs(libs: string[]) {\n libs.map(url => {\n if (url.endsWith('.css')) {\n return this.injectHtml.push({\n attributes: {\n href: url,\n rel: 'stylesheet',\n },\n tagName: 'link',\n })\n }\n this.injectHtml.push({\n attributes: {\n src: url,\n },\n tagName: 'script',\n })\n })\n }\n private injectGlobalVal() {\n if (!this.op.empRuntime) return\n const {empRuntime} = this.op\n const {injectHtml} = this\n const frameworkGlobal = this.fk.global || (empRuntime.shareLib ? 'window' : '')\n const injectGlobalValToHtml = empRuntime.injectGlobalValToHtml === false || !this.rt.lib ? false : true\n // 插入全局引用变量 让 empRuntime 可以提前实例化 不需要在页面重复实例化\n if (injectGlobalValToHtml) {\n const injectData: any = {frameworkLib: frameworkGlobal, runtimeLib: this.rt.global}\n if (this.fk.name && this.fk.name !== 'none') injectData.framework = this.fk.name\n injectHtml.push({\n // type: 'js',\n tagName: 'script',\n innerHTML: `window.${shareGlobalVal}=${JSON.stringify(injectData)}`,\n })\n }\n }\n public fk!: Required<frameworkOptions>\n private resetFramework() {\n if (!this.op.empRuntime) return\n const {framework, frameworkGlobal, frameworkLib} = this.op.empRuntime\n //\n this.fk = {\n name: 'none',\n version: 0,\n entry: '',\n global: frameworkGlobal || '',\n lib: frameworkLib || '',\n libs: [],\n }\n //\n if (typeof framework === 'string') {\n this.fk.name = framework as any\n }\n // TODO 通用 CDN 的适配方案\n else if (typeof framework === 'object' && Object.keys(framework).length > 0) {\n // 默认 框架名 为入口\n framework.entry = framework.entry ? framework.entry : framework.name\n this.fk = deepAssign(this.fk, framework)\n }\n }\n public rt!: Required<runtimeLibType>\n private resetRuntime() {\n const {empRuntime} = this.op\n if (!empRuntime) return\n const global = empRuntime.runtimeGlobal || shareGlobalName\n const lib = empRuntime.runtimeLib ? empRuntime.runtimeLib : empRuntime.runtime?.lib ? empRuntime.runtime.lib : ''\n this.rt = {\n lib,\n global,\n }\n }\n private setExternal() {\n if (!this.op.empRuntime) return\n const {store, externalsLib} = this\n const {empRuntime} = this.op\n const {shareLib} = empRuntime\n //\n const externalRuntime = this.rt.lib\n ? {\n '@module-federation/runtime': `MFRuntime`,\n '@module-federation/sdk': `MFSDK`,\n }\n : {}\n const externals = {}\n for (const [key, value] of Object.entries(externalRuntime)) {\n externals[key] = `${this.rt.global}.${value}`\n }\n /**\n * TODO\n * 框架相关内容需要移除 share 由外部简化配置实现\n */\n if (this.fk.name === 'react' && !shareLib && this.fk.global) {\n const version = this.fk.version\n const externalReact = {\n react: `React`,\n 'react-dom': `ReactDOM`,\n }\n if (this.fk.entry === 'reactRouter') {\n externalReact['react-router-dom'] = 'ReactRouterDOM'\n }\n for (const [key, value] of Object.entries(externalReact)) {\n externals[key] = `${this.fk.global}.${value}`\n }\n if ([17, 18, 19].includes(version)) {\n externals['react-dom/client'] = this.fk.global\n externals['react/jsx-runtime'] = this.fk.global\n externals['react/jsx-dev-runtime'] = this.fk.global\n }\n }\n if (shareLib) {\n externalsLib.map(v => {\n if (v.type === 'js' && v.module && v.global) {\n externals[v.module] = `${this.fk.global}.${v.global}`\n }\n })\n }\n if (empRuntime.setExternals) empRuntime.setExternals(externals, this.fk.global, this.rt.global)\n //\n // console.log('externals in plugin', externals)\n store.chain.merge({externals})\n }\n private setRuntimeLib() {\n if (!this.op.empRuntime) return\n\n const {shareLib} = this.op.empRuntime\n const {store, injectHtml} = this\n const {empRuntime} = this.op\n if (!this.rt.lib) {\n // 内置 this.rt.lib\n store.chain.plugin('plugin-emp-share-framework').use(EmpShareRemoteLibPlugin, [empRuntime])\n }\n // 统一封装到 frameworkLib\n else if (this.rt.lib === 'useFrameworkLib' && !shareLib) {\n } else {\n // 插入 runtime\n injectHtml.push({tagName: 'script', pos: 'head', attributes: {src: this.rt.lib}})\n }\n }\n private setMfName() {\n if (this.op.name) {\n this.op.name = this.store.encodeVarName(this.op.name)\n if (this.op.name !== this.store.empConfig.output.uniqueName) {\n this.store.chain.output.set('uniqueName', this.op.name)\n }\n } else {\n this.op.name = this.store.empConfig.output.uniqueName\n }\n }\n private setMF() {\n const o = this.op\n const {store} = this\n if (o.name) {\n this.setDtsRuntimePkgs()\n const op = store.deepAssign<ModuleFederationPluginOptions & {empRuntime: any}>(\n {\n filename: 'emp.js',\n // manifest: false,\n // dts: false,\n // dev: {\n // disableDynamicRemoteTypeHints: true,\n // },\n },\n o,\n )\n //\n // if (o.dev === false) op.dev = false\n //\n if (op.empRuntime) {\n delete op.empRuntime\n }\n /**\n * 注册 forceRemotes\n */\n if (o.forceRemotes) {\n registerRemotes(store, o.forceRemotes)\n delete o.forceRemotes\n op.runtimePlugins ??= []\n op.runtimePlugins.push(resolvePackageExport('@empjs/share/forceRemote'))\n }\n // console.log('op', op)\n store.chain.plugin('plugin-emp-share').use(ModuleFederationPlugin, [op])\n }\n }\n private setDtsRuntimePkgs() {\n if (!this.op.empRuntime || this.op.dts === false) return\n\n const dts = this.op.dts === true || this.op.dts == null ? {} : {...(this.op.dts as any)}\n if (dts.consumeTypes === false) {\n this.op.dts = dts\n return\n }\n\n const consumeTypes = dts.consumeTypes === true || dts.consumeTypes == null ? {} : {...dts.consumeTypes}\n consumeTypes.runtimePkgs = mergeRuntimeTypePkgs(consumeTypes.runtimePkgs)\n dts.consumeTypes = consumeTypes\n this.op.dts = dts\n }\n private setShareLib() {\n if (!this.op.empRuntime) return\n const {shareLib} = this.op.empRuntime\n const {externalsLib, injectHtml} = this\n if (shareLib && typeof shareLib === 'object') {\n for (const [k, v] of Object.entries(shareLib)) {\n let externalsItem: ExternalsItemType = {}\n externalsItem.module = k\n //增加下划线 支持lodash 等特殊符号的问题 如 _@http\n\n if (typeof v === 'string') {\n const cb: any = v.match(exp) || []\n if (cb.length > 0) {\n externalsItem.global = cb[1]\n externalsItem.entry = cb[2]\n externalsItem.type = 'js'\n externalsLib.push(externalsItem)\n externalsItem = {}\n } else {\n externalsItem.global = ''\n externalsItem.entry = v\n externalsItem.type = 'js'\n externalsLib.push(externalsItem)\n externalsItem = {}\n }\n } else if (Array.isArray(v)) {\n v.map(vo => {\n if (!vo) return\n const isCSS = vo.split('?')[0].endsWith('.css')\n if (isCSS) {\n externalsItem.entry = vo\n externalsItem.type = 'css'\n } else {\n const cb: any = vo.match(exp) || []\n if (cb.length > 0) {\n externalsItem.global = cb[1]\n externalsItem.entry = cb[2]\n externalsItem.type = 'js'\n } else {\n externalsItem.global = ''\n externalsItem.entry = vo\n externalsItem.type = 'js'\n }\n }\n externalsLib.push(externalsItem)\n externalsItem = {}\n })\n } else if (typeof v === 'object' && v.entry) {\n externalsItem.entry = v.entry\n externalsItem.global = v.global\n externalsItem.type = v.type\n externalsLib.push(externalsItem)\n externalsItem = {}\n }\n }\n // console.log(externalsLib)\n externalsLib.map(v => {\n if (v.type === 'js') {\n injectHtml.push({\n attributes: {\n src: v.entry,\n },\n tagName: 'script',\n })\n } else if (v.type === 'css') {\n injectHtml.push({\n attributes: {\n href: v.entry,\n rel: 'stylesheet',\n },\n tagName: 'link',\n })\n }\n })\n }\n }\n}\n","import type {EMPSHARERuntimeOptions} from './types'\nexport function getRuntimeLib(host: EMPSHARERuntimeOptions['frameworkLib'], mode: string, entry = 'runtime') {\n if (typeof host === 'string') {\n if (entry === 'runtime') {\n return `${host}/runtime${mode === 'development' ? '.development' : ''}.umd.js`\n } else {\n return `${host}/${entry}.${mode}.umd.js`\n }\n } else if (typeof host === 'object') {\n if (mode === 'development') return host.dev\n else return host.prod\n }\n return ''\n}\n","import {type GlobalStore} from '@empjs/cli'\nimport {shareForceRemote} from 'src/helper/config'\nimport {ForceRemoteOptions} from '../types'\n\nexport const registerRemotes = (store: GlobalStore, forceRemotes: ForceRemoteOptions) => {\n if (Object.keys(forceRemotes).length > 0) {\n store.injectTags(\n [\n {\n innerHTML: `window.${shareForceRemote} = ${JSON.stringify(forceRemotes)};`,\n tagName: 'script',\n pos: 'head',\n },\n ],\n 'EMP_FORCE_REMOTES',\n )\n }\n}\n","import type {GlobalStore} from '@empjs/cli'\nimport {EmpShare} from './share'\nimport type {EMPPluginShareType} from './types'\nexport type {EMPPluginShareType}\n//\nexport * from 'src/framework/react/config'\nexport * from 'src/framework/vue/config'\nexport * from './types'\n//\nexport const pluginRspackEmpShare = (o: EMPPluginShareType = {}) => {\n return {\n name: '@empjs/share',\n async rsConfig(store: GlobalStore) {\n //\n if (o.manifest === true) {\n o.manifest = {\n fileName: 'emp.json',\n }\n } else if (typeof o.manifest === 'object') {\n o.manifest = store.deepAssign({fileName: 'emp.json'}, o.manifest)\n }\n const empShare = new EmpShare(o, store)\n empShare.setup()\n },\n }\n}\nexport default pluginRspackEmpShare\n"],"names":["resolveFrom","baseFile","specifier","createRequire","EmpShareRemoteLibPlugin","compiler","webpack","entry","importJsVm","undefined","op","exp","empShareRuntimeTypePkgs","EmpShare","store","injectHtml","url","getRuntimeLib","host","mode","libs","empRuntime","frameworkGlobal","injectData","shareGlobalVal","JSON","framework","frameworkLib","Object","deepAssign","_empRuntime_runtime","global","shareGlobalName","lib","externalsLib","shareLib","externalRuntime","externals","key","value","version","externalReact","v","o","forceRemotes","shareForceRemote","_op","resolvePackageExport","resolve","process","error","currentModuleFile","getCurrentModuleFile","prepareStackTrace","Error","_error","stack","Array","file","callSite","fileName","fileURLToPath","ModuleFederationPlugin","dts","consumeTypes","mergeRuntimeTypePkgs","runtimePkgs","Set","k","externalsItem","cb","vo","pluginRspackEmpShare","empShare"],"mappings":"oVAsBA,SAASA,EAAYC,CAAgB,CAAEC,CAAiB,EACtD,OAAOC,EAAcF,GAAU,OAAO,CAACC,EACzC,CCfO,MAAME,EAKX,MAAMC,CAAkB,CAAE,CACxB,GAAM,CAACC,QAAAA,CAAO,CAAC,CAAGD,EACZE,EAVDC,EADS,iCAYd,IAAIF,EAAQ,WAAW,CAACD,EAAS,OAAO,CAAEE,EAAO,CAC/C,KAAME,MACR,GAAG,KAAK,CAACJ,EACX,CATA,YAAYK,CAA0B,CAAE,K,MADxC,O,GAAA,kB,sBAAA,K,uDAAA,I,MAEE,IAAI,CAAC,OAAO,CAAGA,CACjB,CAQF,C,4bCLA,IAAMC,EAAM,0BACNC,EAA0B,CAAC,mBAAmB,AAM7C,OAAMC,EAeX,OAAQ,CACN,IAAI,CAAC,YAAY,GACjB,IAAI,CAAC,cAAc,GACnB,IAAI,CAAC,SAAS,GACd,IAAI,CAAC,KAAK,GACV,IAAI,CAAC,eAAe,GACpB,IAAI,CAAC,eAAe,GACpB,IAAI,CAAC,WAAW,GAChB,IAAI,CAAC,aAAa,GAClB,IAAI,CAAC,YAAY,GACjB,IAAI,CAAC,WAAW,EAClB,CACQ,cAAe,CACrB,GAAM,CAACC,MAAAA,CAAK,CAAEC,WAAAA,CAAU,CAAC,CAAG,IAAI,AAC5BA,CAAAA,EAAW,MAAM,CAAG,GACtBD,EAAM,UAAU,CAACC,EAAY,WAEjC,CACQ,iBAAkB,CACxB,GAAI,IAAI,CAAC,EAAE,EAAI,IAAI,CAA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