@moneko/core 3.9.6 → 3.9.8-beta.0
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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});const e=require("buffer"),t=require("lightningcss"),r={Declaration:{custom
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});const e=require("buffer"),t=require("lightningcss"),r={Declaration:{custom(e){if("content"===e.name&&1===e.value.length){let t=e.value[0];if("token"===t.type&&"string"===t.value.type)return[{property:e.name,raw:JSON.stringify(t.value.value.replace(/[\u4e00-\u9faF]/g,function(e){return`\\${e.charCodeAt(0).toString(16)}`}))}]}}}};async function n(n,i){let a=this.async(),{implementation:o,visitor:s,rem:u,...c}=this.getOptions();if(o&&"function"!=typeof o.transform){this.cacheable(!1),a(TypeError(`[lightningcss]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof o.transform}`));return}let f=o?.transform?o.transform:t.transform;try{u&&!r.Length&&(r.Length=function(e){if("px"===e.unit)return{unit:"rem",value:e.value/16}});let{code:t,map:o}=f({filename:this.resourcePath,code:e.Buffer.from(n),minify:!0,visitor:{...r,...s},sourceMap:!!this.sourceMap,inputSourceMap:this.sourceMap&&i?JSON.stringify(i):void 0,...c});this.cacheable(!0),a(null,t.toString(),o&&JSON.parse(o.toString()))}catch(e){this.cacheable(!1),a(e)}}
|
|
@@ -4,4 +4,4 @@ export interface LightningCssLoaderOption extends Omit<TransformOptions<CustomAt
|
|
|
4
4
|
rem?: boolean;
|
|
5
5
|
implementation?: typeof import('lightningcss');
|
|
6
6
|
}
|
|
7
|
-
export default function LightningCssLoader(this: LoaderContext<LightningCssLoaderOption>, source: string, prevMap?:
|
|
7
|
+
export default function LightningCssLoader(this: LoaderContext<LightningCssLoaderOption>, source: string, prevMap?: string): Promise<void>;
|
package/lib/module-federation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"webpack";import
|
|
1
|
+
import e from"webpack";import{CONFIG as r}from"./config.js";import t from"./plugin/external-remotes.js";import{realResolve as o}from"./utils.js";let{NormalModuleReplacementPlugin:s,container:{ModuleFederationPlugin:a}}=e,i={},l={},n={},m=r.moduleFederation?.map(e=>{if(Array.isArray(e.remotes))for(let r=0,t=e.remotes.length;r<t;r++){let t=e.remotes[r],o=t.alias||t.name,s=t.filename||"remote_entry.js";if(n[o]=`${t.name}@${t.host}/${s}`,Array.isArray(t.library))for(let e=0,r=t.library.length;e<r;e++)i[t.library[e]]=`${o}/${t.library[e]}`}if(Array.isArray(e.exposes))for(let r=0,t=e.exposes.length;r<t;r++){let t=e.exposes[r];"string"==typeof t?l[`./${t}`]=o(t):"[object Object]"===Object.prototype.toString.call(t)&&(l[`./${t.name}`]=o(t.path))}return new a({filename:"remote_entry.js",...e,remotes:n,exposes:l})});m.length&&(m.push(new t),m.push(new s(/(.*)/,e=>{i[e.request]&&(e.request=i[e.request])})));export default m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"webpack";
|
|
1
|
+
import e from"webpack";let{sources:t}=e,r="ExternalRemotesPlugin";export default class{apply(e){e.hooks.make.tap(r,e=>{let n=[];e.hooks.buildModule.tap(r,e=>{"ExternalModule"===e.constructor.name&&"script"===e.externalType&&n.push(e)}),e.hooks.afterCodeGeneration.tap(r,function(){n.map(r=>{let n=function(e){let t=e.indexOf("@");if(t<=0||t===e.length-1)throw Error(`Invalid request "${e}"`);return[e.substring(t+1),e.substring(0,t)]}(r.request)[0],o=function(e){let t=[],r=[],n=!1,o=!1;for(let l of e)if("["===l){if(n){o=!0;break}n=!0,r.length&&(t.push(`"${r.join("")}"`),r.length=0)}else if("]"===l){if(!n){o=!0;break}n=!1,r.length&&(t.push(`${r.join("")}`),r.length=0),r.length=0}else r.push(l);if(n||o)throw Error(`Invalid template URL "${e}"`);return r.length&&t.push(`"${r.join("")}"`),t.join(" + ")}(n),l=e.codeGenerationResults.get(r,void 0).sources;l.set("javascript",new t.RawSource(l.get("javascript")?.source().replace(`"${n}"`,o)))})})})}}
|