@moneko/core 4.4.4-beta.2 → 4.4.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,parse as t,relative as r}from"node:path";import o from"webpack";import
|
|
1
|
+
import{join as e,parse as t,relative as r}from"node:path";import o from"webpack";import m from"../commom/module-resolve.mjs";import s from"../commom/paths.mjs";import{CONFIG as a}from"../config.mjs";import i from"../utils/fetch-module-federation-dts.mjs";import{resolveProgram as l}from"../utils/index.mjs";import{mf_vm as n}from"../vm/mf.mjs";import{ModuleFederationExposesDeclarationPlugin as p}from"./exposes-declararion.mjs";import{ExternalRemotesPlugin as f}from"./external-remotes.mjs";let h=o.NormalModuleReplacementPlugin,c=o.container.ModuleFederationPlugin,u={},d=[];function y(e,r){let o=e.replace(/\.tsx?$/i,""),m=t(r);n.setData(o,{type:".tsx",source:()=>`export * from '${t(m.dir).name}/${m.name}'`})}let j=a.moduleFederation?.map(t=>{let o={},a={},n={};if(Array.isArray(t.remotes))for(let e=0,r=t.remotes.length;e<r;e++){let r=t.remotes[e],o=r.alias||r.name,m=r.filename||"remote_entry.js";if(a[o]=`${r.name}@${r.host}/${m}`,Array.isArray(r.library))for(let e=0,t=r.library.length;e<t;e++)u[r.library[e]]=`${o}/${r.library[e]}`;i(r.host,r.name)}if(Array.isArray(t.exposes)){t.exposes.length>0&&!t.exposes.find(e=>"public-path"===e)&&t.exposes.push({name:"public-path",path:`./${r(s.programPath,e(s.corePath,"./polyfills/public-path.mjs"))}`});for(let e=0,r=t.exposes.length;e<r;e++){let r=t.exposes[e];if("string"==typeof r){let e=r.startsWith(".");o[`./${r}`]=m(e?l(r):r),e&&(n[r]=o[`./${r}`],y(r,n[r]))}else if("[object Object]"===Object.prototype.toString.call(r)){let e=r.path.startsWith(".");o[`./${r.name}`]=m(e?l(r.path):r.path),e&&(n[`./${r.name}`]=o[`./${r.name}`],y(`./${r.name}`,n[`./${r.name}`]))}}t.exposes?.length&&d.push(new p({exposes:n,name:t.name}))}return new c({filename:"remote_entry.js",...t,remotes:a,exposes:o})});j.length>0&&(j.push(new f),j.push(new h(/(.*)/,e=>{u[e.request]&&(e.request=u[e.request])})),d.forEach(e=>j.push(e))),a.env.injectRemoteReactRefresh=Object.keys(u).includes("react-dom");export default j;
|
package/package.json
CHANGED
package/typings/global.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export type DevtoolOption =
|
|
|
69
69
|
| 'hidden-source-map';
|
|
70
70
|
export type RulesInclude = {
|
|
71
71
|
css?: RuleSetConditionAbsolute[];
|
|
72
|
-
js?:
|
|
72
|
+
js?: RuleSetConditionAbsolute[];
|
|
73
73
|
media?: RuleSetConditionAbsolute[];
|
|
74
74
|
font?: RuleSetConditionAbsolute[];
|
|
75
75
|
wasm?: RuleSetConditionAbsolute[];
|