@moneko/core 3.36.2 → 3.36.3-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.
- package/lib/build/common.mjs +1 -1
- package/lib/common.mjs +1 -1
- package/lib/loader/lightning-css/loader.cjs +1 -1
- package/lib/loader/lightning-css/utils.cjs +1 -1
- package/lib/module.config.mjs +2 -2
- package/lib/plugin/compression.d.mts +17 -0
- package/lib/plugin/compression.mjs +1 -0
- package/lib/plugin/html-plugin.mjs +1 -1
- package/lib/plugins.config.d.mts +1 -1
- package/lib/plugins.config.mjs +1 -1
- package/package.json +4 -5
package/lib/build/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"mini-css-extract-plugin";import i from"webpack";import{merge as n}from"webpack-merge";import{commonConfig as
|
|
1
|
+
import e from"mini-css-extract-plugin";import i from"webpack";import{merge as n}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as m}from"../config.mjs";import{LightningCssMinifyPlugin as r}from"../plugin/lightningcss-plugin.mjs";import s from"../plugin/swc-minify-plugin.mjs";import{getLightningCssTargets as l}from"../polyfills/targets.mjs";let o=[];m.minifier&&(o.push(new s(m.minifier)),o.push(new r({targets:l()})));let p={maxAssetSize:256e3,maxEntrypointSize:256e3,assetFilter:e=>!e.endsWith(".map")&&!e.endsWith("ce28377f3a428346.js"),...m.performance},a=n(t,{performance:m.performance&&p,plugins:[new e({filename:"style/[contenthash].css",chunkFilename:"style/[contenthash].css",ignoreOrder:!0})],optimization:{splitChunks:m.splitChunk,runtimeChunk:m.runtimeChunk,chunkIds:"deterministic",moduleIds:"deterministic",concatenateModules:!0,emitOnErrors:!1,removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:o}});if(m.splitChunk&&a.plugins?.push(new i.optimize.MinChunkSizePlugin({minChunkSize:51200})),m.bundleAnalyzer){let e=(await import("webpack-bundle-analyzer")).BundleAnalyzerPlugin;a.plugins?.push(new e({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...m.bundleAnalyzer}))}export default a;
|
package/lib/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extname as e,join as t,resolve as o}from"node:path";import s,{config_files as n,CUSTOMCONFIG as a}from"./commom/paths.mjs";import i from"./commom/require.mjs";import r from"./plugin/override-resolve.mjs";import{isObject as l,node_modules as m,resolveProgram as p}from"./utils/index.mjs";import{exampleModuleName as c}from"./vm/example.mjs";import u from"./vm/info.mjs";import{CONFIG as h,PUBLICPATH as f}from"./config.mjs";import d from"./plugins.config.mjs";import{isDev as g,isLibrary as b,NODE_ENV as y,packageJson as j}from"./process-env.mjs";export const outputConfig={path:p(b?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename
|
|
1
|
+
import{extname as e,join as t,resolve as o}from"node:path";import s,{config_files as n,CUSTOMCONFIG as a}from"./commom/paths.mjs";import i from"./commom/require.mjs";import r from"./plugin/override-resolve.mjs";import{isObject as l,node_modules as m,resolveProgram as p}from"./utils/index.mjs";import{exampleModuleName as c}from"./vm/example.mjs";import u from"./vm/info.mjs";import{CONFIG as h,PUBLICPATH as f}from"./config.mjs";import d from"./plugins.config.mjs";import{isDev as g,isLibrary as b,NODE_ENV as y,packageJson as j}from"./process-env.mjs";export const outputConfig={path:p(b?"docs":"dist"),filename:"js/[name].[contenthash].bundle.js",chunkFilename:"js/[contenthash].chunk.js",assetModuleFilename:t=>{let o=e(t.filename||"").substring(1);return`assets/${o}/[hash][ext]`},library:{name:`${u.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${j.name}`,pathinfo:g,clean:!0,publicPath:f,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"anonymous",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let v={main:[m("@app/entry")]};if(h.polyfill&&v.main.unshift(t(s.corePath,"./polyfills/replace-children.mjs")),g&&h.refresh&&h.env.injectRemoteReactRefresh&&v.main.unshift(i.resolve("@moneko/react/lib/injectRemoteReactRefresh.js")),h.entry&&("string"==typeof h.entry?v={main:[h.entry]}:Object.keys(h.entry)&&(v=Object.assign(v,h.entry))),"string"==typeof v.main&&(v.main=[v.main]),h.output){if("string"==typeof h.output)outputConfig.path=h.output;else if(Object.keys(h.output)){let e=h.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof h.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let C={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.webpackCachePath,memoryCacheUnaffected:!0,name:`.${[a,y].filter(Boolean).join("-")}`,version:`${j.version}`,buildDependencies:{config:n}};!1===h.cache?C=!1:l(h.cache)&&(C=Object.assign(C,h.cache));export const commonConfig={name:"client",target:"web",devtool:h.devtool,entry:v,mode:g?"development":"production",stats:"errors-only",cache:C,snapshot:{immutablePaths:[/node_modules\/(?!(@app|@moneko)\/)/],managedPaths:[/^@app\/.+/,/^@moneko\/.+/],buildDependencies:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:h.externalsPresets,plugins:d,node:{global:!1,__filename:!1,__dirname:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:h.lazyCompilation&&g&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(m(c))||t.startsWith(m("@app/comment"))||t.startsWith(s.pagesPath)||t.startsWith(s.componentsPath)))}},buildHttp:l(h.buildHttp)?{allowedUris:[],lockfileLocation:o(s.httpCachePath,"http.lock"),cacheLocation:o(s.httpCachePath,"data"),upgrade:!0,...h.buildHttp}:h.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:h.alias,modules:[s.nodeModules,s.pnpmNodeModules,s.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:h.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:h.externals,output:outputConfig};h.overrideResolve&&commonConfig.resolve.plugins.push(new r(Object.assign({original:h.alias["@"],override:a&&p(a)},h.overrideResolve)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _}});const t=require("lightningcss"),r=(e=require("../../commom/log.mjs"))&&e.__esModule?e:{default:e},s=require("../../process-env.mjs"),i=require("./codegen.cjs"),o=require("./utils.cjs");function l(e,t){return JSON.stringify(e.utils.contextify(e.context||e.rootContext,t))}const n=new TextEncoder,u={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 _(e,_){let a=this.async();this.cacheable&&this.cacheable();let{implementation:p,visitor:c,rem:f,...m}=this.getOptions(),d=!!m.modules?.auto?.(this.resourcePath);if(d&&void 0===m.modules.namedExport&&(m.modules.namedExport=!0),p&&"function"!=typeof p.transform){a(TypeError(`[lightning-loader]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof p.transform}`));return}let h=[],R=[],S=[],g=[],L=[];m.modules?.exportOnlyLocals!==!0&&R.unshift({type:"api_import",importName:"___CSS_LOADER_API_IMPORT___",url:l(this,require.resolve("./runtime/api.cjs"))});let O=p?.transform?p.transform:t.transform,y=new Map,E=new Map,v=new Map,C=function(e,t,r,s,i,l){let n=new Map,u=!1,_=new Map,a=new Map,p=-1,c=-1;return{Rule:{import(s){let i;if(e.importFilter&&!e.importFilter(s.value.url,s.value.media))return s;let u=s.value.url;c++,l.set(c,u),u=`__MO_LIGHTNINGCSS_LOADER_IMPORT_URL_REPLACE_${c}__`;let _=s.value.media.mediaQueries.length?JSON.stringify(s.value.media.mediaQueries):void 0,a=(0,o.isUrlRequestable)(u);if(a){let e=u.split("!");e.length>1&&(u=e.pop(),i=e.join("!"))}if(!a)return t.push({url:u,media:_}),{type:"ignored",value:""};let p=i?`${i}!${u}`:u,f=n.get(p);if(!f){f=`___CSS_LOADER_AT_RULE_IMPORT_${n.size}___`,n.set(p,f);let t=e.urlHandler(p);r.push({type:"rule_import",importName:f,url:t})}return t.push({importName:f,media:_}),{type:"ignored",value:""}}},Url:t=>(function(t){let l,n=t.url;if(!e.urlFilter(n)||n.startsWith("#")||(0,o.isDataUrl)(n))return t;p++,i.set(p,n);let[,c,f]=(n=`__MO_LIGHTNINGCSS_LOADER_URL_REPLACE_${p}__`).split(/(\?)?#/,3),m=n.split("!");m.length>1&&(n=m.pop(),l=m.join("!"));let d=c?"?":"";d+=f?`#${f}`:"",u||(r.push({type:"get_url_import",importName:"___CSS_LOADER_GET_URL_IMPORT___",url:JSON.stringify(require.resolve("./runtime/get-url.cjs")),index:-1}),u=!0);let h=l?`${l}!${n}`:n,R=_.get(h);R||(R=`___CSS_LOADER_URL_IMPORT_${_.size}___`,_.set(h,R),r.push({type:"url",importName:R,url:JSON.stringify(h),index:p}));let S=JSON.stringify({newUrl:h,hash:d,needQuotes:!1}),g=a.get(S);return g||(g=`___CSS_LOADER_URL_REPLACEMENT_${a.size}___`,a.set(S,g),s.push({replacementName:g,importName:R,hash:d,needQuotes:!1})),{loc:t.loc,url:g}})(t)}}({urlHandler:e=>l(this,(0,o.getPreRequester)(this)(m.importLoaders??0)+e),urlFilter:(0,o.getFilter)(m.url,this.resourcePath),importFilter:(0,o.getFilter)(m.import,this.resourcePath),context:this.context},g,R,L,y,v),M=function({apis:e,imports:t,replacements:r,replacedUrls:s,urlHandler:i}){let o=-1,l=-1;return{Declaration:{composes(n){if("unparsed"===n.property)return;let u=n.value.from;if(u?.type!=="file")return;let _=u.value;if(!_)return;o++,s.set(o,_),_=`__MO_LIGHTNINGCSS_LOADER_ICSS_URL_REPLACE_${o}__`;let a=`___CSS_LOADER_ICSS_IMPORT_${t.length}___`;t.push({type:"icss_import",importName:a,icss:!0,url:i(_),index:o}),e.push({importName:a,dedupe:!0,index:o});let p=[];for(let e of n.value.names){l++;let t=`___CSS_LOADER_ICSS_IMPORT_${o}_REPLACEMENT_${l}___`;r.push({replacementName:t,importName:a,localName:e}),p.push(t)}return{property:"composes",value:{loc:n.value.loc,names:p,from:u}}}}}}({apis:g,imports:S,replacements:L,replacedUrls:E,urlHandler:e=>l(this,(0,o.getPreRequester)(this)(m.importLoaders)+e)});try{f&&!u.Length&&(u.Length=function(e){if("px"===e.unit)return{unit:"rem",value:e.value/16}});let{code:t,map:r,exports:l}=O({filename:this.resourcePath,code:n.encode(e),minify:!0,visitor:{...u,...C,...M,...c},cssModules:!!d&&{pattern:m.modules.localIdentName},sourceMap:this.sourceMap,inputSourceMap:this.sourceMap&&_?JSON.stringify(_):void 0,analyzeDependencies:!1,drafts:{customMedia:!0},include:1,errorRecovery:!1,unusedSymbols:[],...m}),p=t.toString();if(l){for(let e in l)if(Object.prototype.hasOwnProperty.call(l,e)){let t=l[e],r=t.name;for(let e of t.composes)r+=` ${e.name}`;h.push({name:e,value:r})}m.modules.getJSON?.({resourcePath:this.resourcePath,exports:h})}if(0!==y.size){if(s.IS_WINDOW)for(let[e,t]of y.entries())for(let r of R)r.url=r.url.replace(`__MO_LIGHTNINGCSS_LOADER_URL_REPLACE_${e}__`,t);else{let e=this.getResolve({conditionNames:["asset"],mainFields:["asset"],mainFiles:[],extensions:[]});for(let[t,r]of y.entries()){let[s]=r.split(/(\?)?#/,3),i=(0,o.requestify)(s,this.rootContext),l=await (0,o.resolveRequests)(e,this.context,[...new Set([i,r])]);for(let e of R)e.url=e.url.replace(`__MO_LIGHTNINGCSS_LOADER_URL_REPLACE_${t}__`,l??r)}}}if(0!==v.size){let e=this.getResolve({conditionNames:["style"],extensions:[".css"],mainFields:["css","style","main","..."],mainFiles:["index","..."],restrictions:[/\.css$/i]});for(let[t,r]of v.entries()){let[s]=r.split(/(\?)?#/,3),i=(0,o.requestify)(s,this.rootContext),l=await (0,o.resolveRequests)(e,this.context,[...new Set([i,r])]);for(let e of R)e.url=e.url.replace(`__MO_LIGHTNINGCSS_LOADER_IMPORT_URL_REPLACE_${t}__`,l??r)}}if(0!==E.size){let e=this.getResolve({conditionNames:["style"],extensions:[],mainFields:["css","style","main","..."],mainFiles:["index","..."]});for(let[t,r]of E.entries()){let[s]=r.split(/(\?)?#/,3),i=(0,o.requestify)(s,this.rootContext),l=await (0,o.resolveRequests)(e,this.context,[...new Set([r,i])]);for(let e of S)e.url=e.url.replace(`__MO_LIGHTNINGCSS_LOADER_ICSS_URL_REPLACE_${t}__`,l??r)}}R.push(...S);let N=(0,i.getImportCode)(R,m),I=(0,i.getModuleCode)({css:p,map:r},g,L,m,this),P=(0,i.getExportCode)(h,L,m)
|
|
1
|
+
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _}});const t=require("lightningcss"),r=(e=require("../../commom/log.mjs"))&&e.__esModule?e:{default:e},s=require("../../process-env.mjs"),i=require("./codegen.cjs"),o=require("./utils.cjs");function l(e,t){return JSON.stringify(e.utils.contextify(e.context||e.rootContext,t))}const n=new TextEncoder,u={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 _(e,_){let a=this.async();this.cacheable&&this.cacheable();let{implementation:p,visitor:c,rem:f,...m}=this.getOptions(),d=!!m.modules?.auto?.(this.resourcePath);if(d&&void 0===m.modules.namedExport&&(m.modules.namedExport=!0),p&&"function"!=typeof p.transform){a(TypeError(`[lightning-loader]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof p.transform}`));return}let h=[],R=[],S=[],g=[],L=[];m.modules?.exportOnlyLocals!==!0&&R.unshift({type:"api_import",importName:"___CSS_LOADER_API_IMPORT___",url:l(this,require.resolve("./runtime/api.cjs"))});let O=p?.transform?p.transform:t.transform,y=new Map,E=new Map,v=new Map,C=function(e,t,r,s,i,l){let n=new Map,u=!1,_=new Map,a=new Map,p=-1,c=-1;return{Rule:{import(s){let i;if(e.importFilter&&!e.importFilter(s.value.url,s.value.media))return s;let u=s.value.url;c++,l.set(c,u),u=`__MO_LIGHTNINGCSS_LOADER_IMPORT_URL_REPLACE_${c}__`;let _=s.value.media.mediaQueries.length?JSON.stringify(s.value.media.mediaQueries):void 0,a=(0,o.isUrlRequestable)(u);if(a){let e=u.split("!");e.length>1&&(u=e.pop(),i=e.join("!"))}if(!a)return t.push({url:u,media:_}),{type:"ignored",value:""};let p=i?`${i}!${u}`:u,f=n.get(p);if(!f){f=`___CSS_LOADER_AT_RULE_IMPORT_${n.size}___`,n.set(p,f);let t=e.urlHandler(p);r.push({type:"rule_import",importName:f,url:t})}return t.push({importName:f,media:_}),{type:"ignored",value:""}}},Url:t=>(function(t){let l,n=t.url;if(!e.urlFilter(n)||n.startsWith("#")||(0,o.isDataUrl)(n))return t;p++,i.set(p,n);let[,c,f]=(n=`__MO_LIGHTNINGCSS_LOADER_URL_REPLACE_${p}__`).split(/(\?)?#/,3),m=n.split("!");m.length>1&&(n=m.pop(),l=m.join("!"));let d=c?"?":"";d+=f?`#${f}`:"",u||(r.push({type:"get_url_import",importName:"___CSS_LOADER_GET_URL_IMPORT___",url:JSON.stringify(require.resolve("./runtime/get-url.cjs")),index:-1}),u=!0);let h=l?`${l}!${n}`:n,R=_.get(h);R||(R=`___CSS_LOADER_URL_IMPORT_${_.size}___`,_.set(h,R),r.push({type:"url",importName:R,url:JSON.stringify(h),index:p}));let S=JSON.stringify({newUrl:h,hash:d,needQuotes:!1}),g=a.get(S);return g||(g=`___CSS_LOADER_URL_REPLACEMENT_${a.size}___`,a.set(S,g),s.push({replacementName:g,importName:R,hash:d,needQuotes:!1})),{loc:t.loc,url:g}})(t)}}({urlHandler:e=>l(this,(0,o.getPreRequester)(this)(m.importLoaders??0)+e),urlFilter:(0,o.getFilter)(m.url,this.resourcePath),importFilter:(0,o.getFilter)(m.import,this.resourcePath),context:this.context},g,R,L,y,v),M=function({apis:e,imports:t,replacements:r,replacedUrls:s,urlHandler:i}){let o=-1,l=-1;return{Declaration:{composes(n){if("unparsed"===n.property)return;let u=n.value.from;if(u?.type!=="file")return;let _=u.value;if(!_)return;o++,s.set(o,_),_=`__MO_LIGHTNINGCSS_LOADER_ICSS_URL_REPLACE_${o}__`;let a=`___CSS_LOADER_ICSS_IMPORT_${t.length}___`;t.push({type:"icss_import",importName:a,icss:!0,url:i(_),index:o}),e.push({importName:a,dedupe:!0,index:o});let p=[];for(let e of n.value.names){l++;let t=`___CSS_LOADER_ICSS_IMPORT_${o}_REPLACEMENT_${l}___`;r.push({replacementName:t,importName:a,localName:e}),p.push(t)}return{property:"composes",value:{loc:n.value.loc,names:p,from:u}}}}}}({apis:g,imports:S,replacements:L,replacedUrls:E,urlHandler:e=>l(this,(0,o.getPreRequester)(this)(m.importLoaders)+e)});try{f&&!u.Length&&(u.Length=function(e){if("px"===e.unit)return{unit:"rem",value:e.value/16}});let{code:t,map:r,exports:l}=O({filename:this.resourcePath,code:n.encode(e),minify:!0,visitor:{...u,...C,...M,...c},cssModules:!!d&&{pattern:m.modules.localIdentName},sourceMap:this.sourceMap,inputSourceMap:this.sourceMap&&_?JSON.stringify(_):void 0,analyzeDependencies:!1,drafts:{customMedia:!0},include:1,errorRecovery:!1,unusedSymbols:[],...m}),p=t.toString();if(l){for(let e in l)if(Object.prototype.hasOwnProperty.call(l,e)){let t=l[e],r=t.name;for(let e of t.composes)r+=` ${e.name}`;h.push({name:e,value:r})}m.modules.getJSON?.({resourcePath:this.resourcePath,exports:h})}if(0!==y.size){if(s.IS_WINDOW)for(let[e,t]of y.entries())for(let r of R)r.url=r.url.replace(`__MO_LIGHTNINGCSS_LOADER_URL_REPLACE_${e}__`,t);else{let e=this.getResolve({conditionNames:["asset"],mainFields:["asset"],mainFiles:[],extensions:[]});for(let[t,r]of y.entries()){let[s]=r.split(/(\?)?#/,3),i=(0,o.requestify)(s,this.rootContext),l=await (0,o.resolveRequests)(e,this.context,[...new Set([i,r])]);for(let e of R)e.url=e.url.replace(`__MO_LIGHTNINGCSS_LOADER_URL_REPLACE_${t}__`,l??r)}}}if(0!==v.size){let e=this.getResolve({conditionNames:["style"],extensions:[".css"],mainFields:["css","style","main","..."],mainFiles:["index","..."],restrictions:[/\.css$/i]});for(let[t,r]of v.entries()){let[s]=r.split(/(\?)?#/,3),i=(0,o.requestify)(s,this.rootContext),l=await (0,o.resolveRequests)(e,this.context,[...new Set([i,r])]);for(let e of R)e.url=e.url.replace(`__MO_LIGHTNINGCSS_LOADER_IMPORT_URL_REPLACE_${t}__`,l??r)}}if(0!==E.size){let e=this.getResolve({conditionNames:["style"],extensions:[],mainFields:["css","style","main","..."],mainFiles:["index","..."]});for(let[t,r]of E.entries()){let[s]=r.split(/(\?)?#/,3),i=(0,o.requestify)(s,this.rootContext),l=await (0,o.resolveRequests)(e,this.context,[...new Set([r,i])]);for(let e of S)e.url=e.url.replace(`__MO_LIGHTNINGCSS_LOADER_ICSS_URL_REPLACE_${t}__`,l??r)}}R.push(...S);let N=(0,i.getImportCode)(R,m),I=(0,i.getModuleCode)({css:p,map:r},g,L,m,this),P=(0,i.getExportCode)(h,L,m);a(null,`${N}${I}${P}`,r&&JSON.parse(r.toString()))}catch(e){a(e),(0,r.default)(e)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(exports,{camelCase:function(){return d},dashesCamelCase:function(){return h},getFilter:function(){return i},getPreRequester:function(){return u},isDataUrl:function(){return l},isUrlRequestable:function(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(exports,{camelCase:function(){return d},dashesCamelCase:function(){return h},getFilter:function(){return i},getPreRequester:function(){return u},isDataUrl:function(){return l},isUrlRequestable:function(){return n},normalizeSourceMapForRuntime:function(){return f},requestify:function(){return s},resolveRequests:function(){return o},urlToRequest:function(){return a}});const e=require("node:path"),t=require("node:url"),r=/^[A-Z]:[/\\]|^\\\\/i;function a(e,t){let a;if(""===e)return"";let o=/^[^?]*~/;if(r.test(e))a=e;else if(void 0!==t&&!1!==t&&e.startsWith("/"))switch(typeof t){case"string":a=o.test(t)?t.replace(/([^~/])$/,"$1/")+e.slice(1):t+e;break;case"boolean":a=e;break;default:throw Error(`Unexpected parameters to loader-utils 'urlToRequest': url = ${e}, root = ${t}.`)}else a=/^\.\.?\//.test(e)?e:`./${e}`;return o.test(a)&&(a=a.replace(o,"")),a}async function o(e,t,r){return e(t,r[0]).then(e=>e).catch(a=>{let[,...s]=r;if(0===s.length)throw a;return o(e,t,s)})}function s(e,r){return/^file:/i.test(e)?(0,t.fileURLToPath)(e):/^[a-z][a-z0-9+.-]*:/i.test(e)?e:"/"===e.charAt(0)?a(e,r):a(e)}function n(e){return!(e.startsWith("//")||/^(https?:)?\/\//.test(e))&&(!!(/^file:/i.test(e)||/^[a-z][a-z0-9+.-]*:/i.test(e))||!e.startsWith("#"))}function l(e){return!!/^data:/i.test(e)}function u({loaders:e,loaderIndex:t}){let r=Object.create(null);return a=>{if(r[a])return r[a];if(!1===a)r[a]="";else{let o=e.slice(t,t+1+("number"!=typeof a?0:a)).map(e=>e.request).join("!");r[a]=`-!${o}!`}return r[a]}}function i(e,t){return(...r)=>"function"!=typeof e||e(...r,t)}const c=/^[a-z]:[/\\]|^\\\\/i,p=/^[a-z0-9+\-.]+:/i;function f(t,r){let a=t?t.toJSON():null;return a&&(delete a.file,a.sourceRoot="",a.sources=a.sources?.map(t=>{var a;if(t.startsWith("<")||"path-relative"!=("/"===t[0]?"/"===t[1]?"scheme-relative":"path-absolute":c.test(t)?"path-absolute":p.test(t)?"absolute":"path-relative"))return t;let o=(0,e.dirname)(r.resourcePath),s=(0,e.resolve)(o,t),n=(a=(0,e.relative)(r.rootContext,s),"\\"===e.sep?a.replace(/\\/g,"/"):a);return`webpack://${n}`})),JSON.stringify(a)}function h(e){return e.replace(/-+(\w)/g,(e,t)=>t.toUpperCase())}const C=(e,t)=>{let r=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let n=e[s];r&&/[\p{Lu}]/u.test(n)?(e=`${e.slice(0,s)}-${e.slice(s)}`,r=!1,o=a,a=!0,s++):a&&o&&/[\p{Ll}]/u.test(n)?(e=`${e.slice(0,s-1)}-${e.slice(s-1)}`,o=a,a=!1,r=!0):(r=n.toLocaleLowerCase(t)===n&&n.toLocaleUpperCase(t)!==n,o=a,a=n.toLocaleUpperCase(t)===n&&n.toLocaleLowerCase(t)!==n)}return e},L=e=>e.replace(/^[\p{Lu}](?![\p{Lu}])/gu,e=>e.toLowerCase()),g=(e,t)=>e.replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu,(e,r)=>r.toLocaleUpperCase(t.locale)).replace(/\d+([\p{Alpha}\p{N}_]|$)/gu,e=>e.toLocaleUpperCase(t.locale)),d=(e,t)=>{if(!("string"==typeof e||Array.isArray(e)))throw TypeError("Expected the input to be `string | string[]`");return(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},0===(e=Array.isArray(e)?e.map(e=>e.trim()).filter(e=>e.length).join("-"):e.trim()).length)?"":1===e.length?t.pascalCase?e.toLocaleUpperCase(t.locale):e.toLocaleLowerCase(t.locale):(e!==e.toLocaleLowerCase(t.locale)&&(e=C(e,t.locale)),e=e.replace(/^[_.\- ]+/,""),e=t.preserveConsecutiveUppercase?L(e):e.toLocaleLowerCase(),t.pascalCase&&(e=e.charAt(0).toLocaleUpperCase(t.locale)+e.slice(1)),g(e,t))};
|
package/lib/module.config.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e;import{join as
|
|
2
|
-
`)}:void 0},importLoaders:2}},O={loader:d.lessLoader,options:{sourceMap:!!P.sourceMap,lessOptions:{modifyVars:c,javascriptEnabled:!0}}},b=new Map;function C(e){if(b.has(e))return b.get(e);try{let
|
|
1
|
+
let e;import{join as s,sep as o}from"node:path";import{saveFileSync as t}from"@moneko/utils";import r,{CUSTOMCONFIG as a}from"./commom/paths.mjs";import n from"./commom/reactive-object.mjs";import i from"./commom/require.mjs";import m from"./commom/rule.mjs";import l from"./options/css-extract.mjs";import c from"./options/modify-vars.mjs";import d from"./options/reslove.mjs";import p from"./options/swcrc.mjs";import{getLightningCssTargets as u}from"./polyfills/targets.mjs";import{node_modules as f,resolveProgram as h,toCamelCase as j}from"./utils/index.mjs";import y from"./utils/svg-to-data-uri.mjs";import{comment as g,getCommentPath as v}from"./vm/docs.mjs";import x from"./vm/generate-doc.mjs";import{outputConfig as w}from"./common.mjs";import{CONFIG as P}from"./config.mjs";import{FRAMEWORK as L,isDev as k,isLibrary as M}from"./process-env.mjs";let _={loader:s(r.corePath,"/loader/lightning-css/loader.cjs"),options:{sourceMap:!!P.sourceMap,targets:u(),rem:!!P.rem,esModule:!0,modules:{auto(e){if(e){if(e.endsWith(".css")&&!e.endsWith("module.css"))return!1;for(let s=0,o=I.length;s<o;s++)if(e.includes(I[s]))return m.css_module.test(e)}return m.node_modules_css_module.test(e)},localIdentName:"[hash]_[local]",namedExport:!0,exportLocalsConvention:"dashesOnly",exportOnlyLocals:!1,getJSON:P.cssModuleDefinition?function(e){q.setData(`${e.resourcePath}.d.ts`,`${e.exports.map(({name:e,value:s})=>`export const ${j(e)}: '${s}';`).join("\n")}
|
|
2
|
+
`)}:void 0},importLoaders:2}},O={loader:d.lessLoader,options:{sourceMap:!!P.sourceMap,lessOptions:{modifyVars:c,javascriptEnabled:!0}}},b=new Map;function C(e){if(b.has(e))return b.get(e);try{let s;let t=i.resolve(e).split(o),r=t.lastIndexOf("node_modules");return s=-1!==r?t.slice(0,r).join(o):t.join(o),b.set(e,[s]),[s]}catch{try{let s=i.resolve(`${e}${o}package.json`).replace(`${o}package.json`,"");b.set(e,[s])}catch{b.set(e,[f(e),f(`.pnpm/${e}`)])}return b.get(e)}}let I=[...P.cssModules,`@moneko/${L}`,"neko-ui"].map(C).flat(),$=["components","example","mock","site","src","server"].map(h);function B(e){return new Promise(s=>{s([...$,r.corePath,...P.rulesInclude?.[e]?.map(C).flat()||[]])})}a&&$.push(h(a)),P.overrideResolve&&P.overrideResolve.override&&$.push(P.overrideResolve.override);let J=await Promise.all([B("css"),B("js"),B("media"),B("wasm"),B("font")]),W=J[0],R=J[1],N=J[2],S=J[3],z=J[4];d.sassLoader&&(e={loader:d.sassLoader,options:{implementation:await import("sass"),sassOptions:{}}});let D=M&&k&&{test:m.tsdoc,include:P.alias["@pkg"],exclude:[/node_modules\/(?!(@app|@moneko)).+/,m.__tests__],enforce:"pre",loader:s(r.corePath,"/loader/ts-doc.cjs"),options:{comment:g,generateDoc:x,getCommentPath:v}},E=w.library?.type==="umd"&&!1===P.htmlPluginOption,Q=[{resourceQuery:/raw/i,type:"asset/source"},{resourceQuery:/url/i,type:"asset/resource",generator:{filename(e){let s=e.filename;return s&&s.toLocaleLowerCase().endsWith("wasm?url")?"wasm/[hash][ext]":"assets/[hash][ext]"}}},{test:m.wasm,type:"webassembly/async",include:S},{test:m.txt,type:"asset/source"},{test:m.image,type:"asset",dependency:{not:["url"]},parser:{dataUrlCondition:E?()=>!0:{maxSize:4096}},generator:{filename:e=>e.filename?.toLocaleLowerCase().endsWith(".svg")?"assets/svg/[hash][ext]":"assets/images/[hash][ext]",dataUrl:(e,s)=>s.filename.toLocaleLowerCase().endsWith(".svg")?y(e.toString()):e},include:N},{test:m.video,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/video/[hash][ext]"},include:N},{test:m.font,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/fonts/[hash][ext]"},include:z}],U=P.prefixJsLoader.filter(Boolean)||[];switch(L){case"react":P.reactCompiler&&U.unshift({loader:s(r.corePath,"/loader/react-compiler.cjs"),options:P.reactCompiler});break;case"solid":P.refresh=!1}P.cssInJs&&"object"==typeof P.cssInJs.minify&&U.unshift({loader:s(r.corePath,"/loader/css-in-js-minify.cjs"),options:Object.assign({moduleName:"@moneko/css",allowFuncs:["css","injectGlobal"]},P.cssInJs.minify)});let q=new n({});q.on("change",(e,s)=>{t(e,s)});export default(o=>{let t={loader:d.swcLoader,options:p(o)};return{parser:{javascript:{commonjsMagicComments:!0,dynamicImportMode:"lazy",dynamicImportPrefetch:!1,dynamicImportPreload:!1,importMeta:!0,importMetaContext:!0}},noParse:P.noParse,rules:[!1!==P.htmlPluginOption&&D,{oneOf:[...Q,{test:m.js,use:[...U,t].filter(Boolean),include:R},{test:m.css,use:[l,_],include:W},e&&{test:m.scss,use:[l,_,e],include:W},{test:m.less,use:[l,_,O],include:W},{test:m.markdown,use:[...U,{loader:s(r.corePath,"/loader/mdx.cjs"),options:P.mdx}].filter(Boolean),exclude:[/node_modules\/(?!(@app|@moneko)).+/]}].filter(Boolean)},...P.moduleRules].filter(Boolean)}});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { compression } from '@moneko/utils';
|
|
2
|
+
import { type AssetInfo, type Compilation, type Compiler, type sources, type WebpackError } from 'webpack';
|
|
3
|
+
type Source = sources.Source;
|
|
4
|
+
interface CompressionPluginOptions {
|
|
5
|
+
test: RegExp;
|
|
6
|
+
algorithm: 'gzip' | 'deflate' | 'brotliCompress';
|
|
7
|
+
filename: string;
|
|
8
|
+
}
|
|
9
|
+
declare class CompressionPlugin {
|
|
10
|
+
private name: string;
|
|
11
|
+
private options: CompressionPluginOptions;
|
|
12
|
+
constructor(options: CompressionPluginOptions);
|
|
13
|
+
private runCompressionAlgorithm(input: Buffer): Buffer;
|
|
14
|
+
async compress(compiler: Compiler, compilation: Compilation, assets: Record<string, Source>);
|
|
15
|
+
apply(compiler: Compiler);
|
|
16
|
+
}
|
|
17
|
+
export default CompressionPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{compression as e}from"@moneko/utils";export default class{constructor(e){this.name="compression-plugin";let{test:s,algorithm:t="gzip",filename:o="[path][base].gz"}=e||{};this.options={test:s,algorithm:t,filename:o}}runCompressionAlgorithm(s){return Buffer.from(e(Buffer.isBuffer(s)?Array.from(s):s,this.options.algorithm))}async compress(e,s,t){let o=s.getCache(this.name),{RawSource:i}=e.webpack.sources;await Promise.all(Object.keys(t).map(async t=>{let r;let{info:a,source:m}=s.getAsset(t),p="gzip"===this.options.algorithm?"gzipped":`${this.options.algorithm}ed`;if(a.compressed||!e.webpack.ModuleFilenameHelpers.matchObject.bind(void 0,this.options)(t)||a.related&&a.related[p])return!1;let n=o.getItemCache(JSON.stringify({name:t,algorithm:this.options.algorithm}),o.getLazyHashedEtag(m)),l=await n.getPromise();if(!l.source){if("function"==typeof m.buffer)r=m.buffer();else{let e=m.source();r=Buffer.isBuffer(e)?e:Buffer.from(e)}if(!l.compressed&&r)try{l.compressed=this.runCompressionAlgorithm(r)}catch(e){s.errors.push(e);return}l.compressed&&(l.source=new i(l.compressed)),await n.storePromise(l)}let f=s.getPath(this.options.filename,{filename:t}),c={compressed:!0};a.immutable&&"string"==typeof this.options.filename&&/(\[name]|\[base]|\[file])/.test(this.options.filename)&&(c.immutable=!0),s.updateAsset(t,m,{related:{[p]:f}}),s.emitAsset(f,l.source,c)}))}apply(e){let s=this.constructor.name;e.hooks.thisCompilation.tap(s,t=>{t.hooks.processAssets.tapPromise({name:s,stage:e.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER,additionalAssets:!0},s=>this.compress(e,t,s))})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as t,readFileSync as e}from"node:fs";import{basename as s,resolve as i}from"node:path";import o from"webpack";export class HtmlPlugin{constructor(t={}){this.AddEntry=/main\.bundle\.js$/,this.faviconPath="",this.name="HtmlPlugin",this.cachedMetaTags=null,this.cachedCustomTags=null,this.options={title:"WebApp",filename:"index.html",inject:"head",...t}}apply(n){n.hooks.compilation.tap(this.name,a=>{a.hooks.processAssets.tap({name:this.name,stage:o.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let h;if(this.options.favicon){let h=i(n.context,this.options.favicon);if(t(h)){let t=s(this.options.favicon),i=e(h);a.emitAsset(t,new o.sources.RawSource(i),{javascriptModule:!1}),this.faviconPath=(a.outputOptions.publicPath||"")+t}else a.warnings.push(new o.WebpackError(`Favicon file ${h} does not exist`))}if(h=this.options.templateContent?this.options.templateContent(this.options):this.options.template?e(i(n.context,this.options.template),{encoding:"utf-8"}):this.generateDefaultTemplate(),this.options.inject){let t=this.getAssets(a);h=this.injectAssets(h,t,this.options.inject)}let r="function"==typeof this.options.filename?this.options.filename("index"):this.options.filename||"index.html";a.emitAsset(r,new o.sources.RawSource(h),{javascriptModule:!1})})})}generateDefaultTemplate(){let t=this.generateMetaTags(),e=this.generateCustomTags();return`<!DOCTYPE html><html><head><meta charset="utf-8">${t}<title>${this.options.title}</title><link rel="icon" type="image/x-icon" href="${this.faviconPath}">${e.head}</head><body><div id="root"></div>${e.body}</body></html>`}generateMetaTags(){if(null!==this.cachedMetaTags)return this.cachedMetaTags;if(!this.options.meta)return this.cachedMetaTags="","";let t=Object.entries(this.options.meta).map(([t,e])=>{if("string"==typeof e)return`<meta name="${t}" content="${e}">`;if(void 0===e)return"";let s=Object.entries(e).map(([t,e])=>`${t}="${e}"`).join(" ");return`<meta ${s}>`}).join("");return this.cachedMetaTags=t,t}generateCustomTags(){if(null!==this.cachedCustomTags)return this.cachedCustomTags;let t={head:"",body:""};if(!this.options.tags)return this.cachedCustomTags=t,t;let e=[],s=[];return this.options.tags.forEach(t=>{let{tag:i="script",textContent:o="",inject:n=this.options.inject,...a}=t,h=Object.entries(a).filter(([,t])=>null!=t).map(([t,e])=>!0===e?t:`${t}="${e}"`).join(" "),r=`<${i} ${h}>${o}</${i}>`;"head"===n?e.push(r):s.push(r)}),t.head=e.join(""),t.body=s.join(""),this.cachedCustomTags=t,t}getAssets(t){let e={js:[],css:[]},s=t.outputOptions.publicPath||"";for(let i of t.entrypoints.values())for(let t of i.chunks)for(let i of t.files)i.endsWith(".js")?e.js.push(s+i):i.endsWith(".css")&&e.css.push(s+i);return e}injectAssets(t,e,s){let i=e.css.length?e.css.map(t=>`<link href="${t}" rel="stylesheet" />`).join(""):"",o=e.js.length?e.js.map(t=>`<script defer ${this.AddEntry.test(t)?'entry="true" ':""}src="${t}"></script>`).join(""):"",n=this.generateCustomTags(),a=t.split("</head>");if(2===a.length){let[t,e]=a,h=e.split("</body>");return"head"===s?`${t}${i}${o}${n.head}</head>${h[0]}${n.body}</body>${h[1]||""}`:`${t}${n.head}</head>${h[0]}${i}${o}${n.body}</body>${h[1]||""}`}return t}}
|
|
1
|
+
import{existsSync as t,readFileSync as e}from"node:fs";import{basename as s,resolve as i}from"node:path";import o from"webpack";export class HtmlPlugin{constructor(t={}){this.AddEntry=/(?:.*\/)?main\.[a-zA-Z0-9]+\.bundle\.js$/,this.faviconPath="",this.name="HtmlPlugin",this.cachedMetaTags=null,this.cachedCustomTags=null,this.options={title:"WebApp",filename:"index.html",inject:"head",...t}}apply(n){n.hooks.compilation.tap(this.name,a=>{a.hooks.processAssets.tap({name:this.name,stage:o.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let h;if(this.options.favicon){let h=i(n.context,this.options.favicon);if(t(h)){let t=s(this.options.favicon),i=e(h);a.emitAsset(t,new o.sources.RawSource(i),{javascriptModule:!1}),this.faviconPath=(a.outputOptions.publicPath||"")+t}else a.warnings.push(new o.WebpackError(`Favicon file ${h} does not exist`))}if(h=this.options.templateContent?this.options.templateContent(this.options):this.options.template?e(i(n.context,this.options.template),{encoding:"utf-8"}):this.generateDefaultTemplate(),this.options.inject){let t=this.getAssets(a);h=this.injectAssets(h,t,this.options.inject)}let r="function"==typeof this.options.filename?this.options.filename("index"):this.options.filename||"index.html";a.emitAsset(r,new o.sources.RawSource(h),{javascriptModule:!1})})})}generateDefaultTemplate(){let t=this.generateMetaTags(),e=this.generateCustomTags();return`<!DOCTYPE html><html><head><meta charset="utf-8">${t}<title>${this.options.title}</title><link rel="icon" type="image/x-icon" href="${this.faviconPath}">${e.head}</head><body><div id="root"></div>${e.body}</body></html>`}generateMetaTags(){if(null!==this.cachedMetaTags)return this.cachedMetaTags;if(!this.options.meta)return this.cachedMetaTags="","";let t=Object.entries(this.options.meta).map(([t,e])=>{if("string"==typeof e)return`<meta name="${t}" content="${e}">`;if(void 0===e)return"";let s=Object.entries(e).map(([t,e])=>`${t}="${e}"`).join(" ");return`<meta ${s}>`}).join("");return this.cachedMetaTags=t,t}generateCustomTags(){if(null!==this.cachedCustomTags)return this.cachedCustomTags;let t={head:"",body:""};if(!this.options.tags)return this.cachedCustomTags=t,t;let e=[],s=[];return this.options.tags.forEach(t=>{let{tag:i="script",textContent:o="",inject:n=this.options.inject,...a}=t,h=Object.entries(a).filter(([,t])=>null!=t).map(([t,e])=>!0===e?t:`${t}="${e}"`).join(" "),r=`<${i} ${h}>${o}</${i}>`;"head"===n?e.push(r):s.push(r)}),t.head=e.join(""),t.body=s.join(""),this.cachedCustomTags=t,t}getAssets(t){let e={js:[],css:[]},s=t.outputOptions.publicPath||"";for(let i of t.entrypoints.values())for(let t of i.chunks)for(let i of t.files)i.endsWith(".js")?e.js.push(s+i):i.endsWith(".css")&&e.css.push(s+i);return e}injectAssets(t,e,s){let i=e.css.length?e.css.map(t=>`<link href="${t}" rel="stylesheet" />`).join(""):"",o=e.js.length?e.js.map(t=>`<script defer ${this.AddEntry.test(t)?'entry="true" ':""}src="${t}"></script>`).join(""):"",n=this.generateCustomTags(),a=t.split("</head>");if(2===a.length){let[t,e]=a,h=e.split("</body>");return"head"===s?`${t}${i}${o}${n.head}</head>${h[0]}${n.body}</body>${h[1]||""}`:`${t}${n.head}</head>${h[0]}${i}${o}${n.body}</body>${h[1]||""}`}return t}}
|
package/lib/plugins.config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CompressionPlugin from 'compression-webpack-plugin';
|
|
2
1
|
import webpack, { type WebpackPluginInstance } from 'webpack';
|
|
2
|
+
import CompressionPlugin from './plugin/compression.mjs';
|
|
3
3
|
import { CopyPlugin } from './plugin/copy.mjs';
|
|
4
4
|
import { HtmlMeta, HtmlPlugin } from './plugin/html-plugin.mjs';
|
|
5
5
|
import moduleFederation from './plugin/module-federation.mjs';
|
package/lib/plugins.config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"webpack";import t from"./plugin/compression.mjs";import{CopyPlugin as i}from"./plugin/copy.mjs";import{HtmlPlugin as o}from"./plugin/html-plugin.mjs";import r from"./plugin/module-federation.mjs";import{VirtualModuleWebpackPlugin as l}from"./plugin/virtual-module.mjs";import{CONFIG as n}from"./config.mjs";import{isDev as p,packageJson as a}from"./process-env.mjs";let s=[...r,new l(n.virtualModule),new i(n.copy),new e.DefinePlugin({"process.env":JSON.stringify(n.env)}),new e.IgnorePlugin({resourceRegExp:/\/(__(tests|mocks)__|test|spec|e2e)\//}),...n.plugins,p&&new t({filename:"[path][base].gz",algorithm:"gzip",test:/\.(js|css|html|svg)$/})].filter(Boolean);if(n.htmlPluginOption){let e={charset:"UTF-8","X-UA-Compatible":{"http-equiv":"X-UA-Compatible",content:"IE=edge,Chrome=1"},HandheldFriendly:"true",MobileOptimized:"320","screen-orientation":"portrait","x5-orientation":"portrait",browsermode:"application","x5-page-mode":"app","msapplication-tap-highlight":"no","mobile-web-app-capable":"yes",renderer:"webkit",description:a.description,keywords:Array.isArray(a.keywords)?a.keywords.toString():"","http-equiv":"refresh",viewport:"width=device-width, initial-scale=1"};n.seo&&(e.relCanonical={rel:"canonical",href:`https://${n.seo.domain}${n.basename}`}),n.htmlPluginOption.meta&&Object.assign(e,n.htmlPluginOption.meta),s.push(new o({...n.htmlPluginOption,meta:e}))}if(n.fixBrowserRouter){let e=n.basename.split("/").filter(Boolean).length,t=`${Array(e).fill("..").join("/")+(e?"/":"")}404.html`,i=n.fixBrowserRouter.pathSegmentsToKeep??e;s.push(new o({filename:n.fixBrowserRouter.path??t,inject:!1,templateContent:()=>`<html lang="en"><head><title>Redirect</title><script>const pathKeep = ${i};const l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>`}))}n.sourceMap&&s.push(new e.SourceMapDevToolPlugin(n.sourceMap));export default s;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.36.
|
|
3
|
+
"version": "3.36.3-beta.0",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -23,15 +23,14 @@
|
|
|
23
23
|
"@moneko/raw-import": "0.0.3",
|
|
24
24
|
"@moneko/stylelint": "1.2.1",
|
|
25
25
|
"@moneko/transform-imports": "0.6.1",
|
|
26
|
-
"@moneko/utils": "0.1
|
|
26
|
+
"@moneko/utils": "0.2.1",
|
|
27
27
|
"@swc/core": "1.6.13",
|
|
28
28
|
"browserslist": "4.24.4",
|
|
29
29
|
"chokidar": "4.0.3",
|
|
30
|
-
"compression-webpack-plugin": "11.1.0",
|
|
31
30
|
"core-js": "3.41.0",
|
|
32
31
|
"core-js-compat": "3.41.0",
|
|
33
32
|
"fastify": "4.29.0",
|
|
34
|
-
"less": "4.
|
|
33
|
+
"less": "4.3.0",
|
|
35
34
|
"less-loader": "12.2.0",
|
|
36
35
|
"lightningcss": "1.29.3",
|
|
37
36
|
"marked-completed": "1.2.14",
|
|
@@ -39,7 +38,7 @@
|
|
|
39
38
|
"mini-css-extract-plugin": "2.9.2",
|
|
40
39
|
"style-loader": "4.0.0",
|
|
41
40
|
"swc-loader": "0.2.6",
|
|
42
|
-
"typescript": "5.8.
|
|
41
|
+
"typescript": "5.8.3",
|
|
43
42
|
"webpack": "5.98.0",
|
|
44
43
|
"webpack-hot-middleware": "2.26.1",
|
|
45
44
|
"webpack-merge": "6.0.1",
|