@moneko/core 4.4.4-beta.4 → 4.4.4-beta.5
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
|
|
1
|
+
import{join as e,parse as t,relative as r,sep as o}from"node:path";import s from"webpack";import m from"../commom/module-resolve.mjs";import a from"../commom/paths.mjs";import{CONFIG as l}from"../config.mjs";import n from"../utils/fetch-module-federation-dts.mjs";import{resolveProgram as p}from"../utils/index.mjs";import{mf_vm as i}from"../vm/mf.mjs";import{ModuleFederationExposesDeclarationPlugin as f}from"./exposes-declararion.mjs";import{ExternalRemotesPlugin as h}from"./external-remotes.mjs";let u=s.NormalModuleReplacementPlugin,c=s.container.ModuleFederationPlugin,d={},$=[];function x(e,r){let s=e.replaceAll(o,"/").replace(/\.tsx?$/i,""),m=t(r);i.setData(s,{type:".tsx",source:()=>{if(r.startsWith(a.nodeModules)){let e=r.substring(a.nodeModules.length).split("node_modules").pop().replaceAll(o,"/").replace(/^\//,"");return`export * from '${e}';`}return r.startsWith(l.alias["@"])?`export * from '@/${t(m.dir).name}/${m.name}'`:"export {};"}})}let y=l.moduleFederation?.map(t=>{let o={},s={},l={};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(s[o]=`${r.name}@${r.host}/${m}`,Array.isArray(r.library))for(let e=0,t=r.library.length;e<t;e++)d[r.library[e]]=`${o}/${r.library[e]}`;n(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(a.programPath,e(a.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?p(r):r),e&&(l[r]=o[`./${r}`],x(`${t.name}/${r}`,l[r]))}else if("[object Object]"===Object.prototype.toString.call(r)){let e=r.path.startsWith(".");o[`./${r.name}`]=m(e?p(r.path):r.path),e&&(l[`./${r.name}`]=o[`./${r.name}`],x(`${t.name}/${r.name}`,l[`./${r.name}`]))}}t.exposes?.length&&$.push(new f({exposes:l,name:t.name}))}return new c({filename:"remote_entry.js",...t,remotes:s,exposes:o})});y.length>0&&(y.push(new h),y.push(new u(/(.*)/,e=>{d[e.request]&&(e.request=d[e.request])})),$.forEach(e=>y.push(e))),l.env.injectRemoteReactRefresh=Object.keys(d).includes("react-dom");export default y;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "4.4.4-beta.
|
|
3
|
+
"version": "4.4.4-beta.5",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -115,7 +115,8 @@
|
|
|
115
115
|
"default": "./lib/lint/stylelint/config.mjs"
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
-
"./package.json": "./package.json"
|
|
118
|
+
"./package.json": "./package.json",
|
|
119
|
+
"./lib/polyfills/public-path.mjs": "./lib/polyfills/public-path.mjs"
|
|
119
120
|
},
|
|
120
121
|
"keywords": [
|
|
121
122
|
"moneko",
|
|
@@ -145,8 +146,8 @@
|
|
|
145
146
|
"less-loader": "12.3.0",
|
|
146
147
|
"lightningcss": "1.30.2",
|
|
147
148
|
"marked-completed": "1.2.15",
|
|
148
|
-
"memfs": "4.
|
|
149
|
-
"swc-loader": "0.2.
|
|
149
|
+
"memfs": "4.52.0",
|
|
150
|
+
"swc-loader": "0.2.7",
|
|
150
151
|
"typescript": "5.9.3",
|
|
151
152
|
"webpack": "5.104.1",
|
|
152
153
|
"webpack-hot-middleware": "2.26.1",
|