@moneko/core 3.24.11 → 3.24.13

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.mjs CHANGED
@@ -1 +1 @@
1
- import o from"webpack";import{merge as r}from"webpack-merge";import i from"./build/common.mjs";import{CONFIG as m}from"./config.mjs";import e from"./module.config.mjs";import t from"./plugin/done.mjs";import n from"./utils/print.mjs";import s from"./utils/seo.mjs";import a from"./utils/progress.mjs";import l from"chalk";import{empty as p}from"./utils/index.mjs";let{ProgressPlugin:c}=o,f=r(i,{module:e(!1),plugins:[m.done&&new t({done:m.done}),!!m.bar&&new c({handler(o,r,...i){let e=m.bar;a({showBar:!0,percentage:o,title:e.name||"Build",color:e.color,info:i.length?`[${r}] ${i.join(" ")}`:"",output:f.output?.path})}})].filter(Boolean)}),u=o(f);async function h(){let o=await new Promise((o,r)=>{u.run((i,m)=>{i&&r(i),m?o(m):r(Error("编译过程中没有生成统计信息"))})});(o.hasErrors()||o.hasWarnings())&&function(o){let{warnings:r,errors:i}=o.compilation;r.forEach(o=>{n(l.yellowBright(o.message))}),i.forEach(o=>{n(l.redBright(o.message))})}(o),await new Promise(r=>{o.compilation.compiler.cache.shutdown(o=>{o&&(n(l.redBright(o)),r()),r()})}),m.seo&&s()}process.on("exit",p),await h();
1
+ import o from"webpack";import{merge as r}from"webpack-merge";import i from"./build/common.mjs";import{CONFIG as m}from"./config.mjs";import e from"./module.config.mjs";import t from"./plugin/done.mjs";import n from"./utils/print.mjs";import s from"./utils/seo.mjs";import a from"./utils/progress.mjs";import l from"chalk";import{empty as p}from"./utils/index.mjs";let{ProgressPlugin:c}=o,f=r(i,{module:e(!1),plugins:[m.done&&new t({done:m.done}),!!m.bar&&new c({handler(o,r,...i){let e=m.bar;a({showBar:!0,percentage:o,title:e.name||"Build",color:e.color,info:i.length?`[${r}] ${i.join(" ")}`:"",output:f.output?.path})}})].filter(Boolean)}),u=o(f);async function h(){let o=await new Promise((o,r)=>{u.run((i,m)=>{i&&r(i),m?o(m):r(Error("编译过程中没有生成统计信息"))})});(o.hasErrors()||o.hasWarnings())&&function(o){let{warnings:r,errors:i}=o.compilation;r.forEach(o=>{n(l.yellowBright(o.message))}),i.forEach(o=>{n(l.redBright(o.message))})}(o),await new Promise(r=>{o.compilation.compiler.cache.shutdown(o=>{o&&n(l.redBright(o)),r()})}),m.seo&&s()}process.on("exit",p),await h();
package/lib/common.mjs CHANGED
@@ -1 +1 @@
1
- import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as a}from"./paths.mjs";import n from"./plugin/override-resolve.mjs";import s from"./plugins.config.mjs";import{NODE_ENV as i,PACKAGENAME as l,PACKAGEVERSION as r,isDev as m,isLibrary as p}from"./process-env.mjs";import{isObject as c,node_modules as u,resolveProgram as h}from"./utils/index.mjs";import{join as d,resolve as f,extname as g}from"path";import{exampleModuleName as b}from"./vm/example.mjs";import y from"./vm/info.mjs";export const outputConfig={path:h(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${m?"name":"contenthash"}].js`,assetModuleFilename:e=>{let t=g(e.filename||"").substring(1);return`assets/${t}/[name][hash][ext]`},library:{name:`${y.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${l}`,pathinfo:m,clean:!0,publicPath:t,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"anonymous",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let j={main:[e.polyfill&&d(o.corePath,"./polyfills/replace-children.mjs"),u("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?j={main:[e.entry]}:Object.keys(e.entry)&&(j=Object.assign(j,e.entry))),"string"==typeof j.main&&(j.main=[j.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let v={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,name:`.${[a,i].filter(Boolean).join("-")}`,version:`${r}`,buildDependencies:{config:[o.configPath,o.customConfigPath]}};!1===e.cache?v=!1:c(e.cache)&&(v=Object.assign(v,e.cache));let C=Object.assign({original:e.alias["@"],override:a&&h(a)},e.overrideResolve);export const commonConfig={name:"client",target:"web",devtool:e.devtool,entry:j,mode:m?"development":"production",stats:"errors-only",cache:v,snapshot:{immutablePaths:[/node_modules\/(?!(@app|@moneko)\/)/],managedPaths:[/^@app\/.+/,/^@moneko\/.+/],buildDependencies:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:e.externalsPresets,plugins:s,node:{global:!1,__filename:!1,__dirname:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:e.lazyCompilation&&m&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(u(b))||t.startsWith(u("@app/comment"))||t.startsWith(o.pagesPath)||t.startsWith(o.componentsPath)))}},buildHttp:c(e.buildHttp)?{allowedUris:[],lockfileLocation:f(o.httpCachePath,"http.lock"),cacheLocation:f(o.httpCachePath,"data"),upgrade:!0,...e.buildHttp}:e.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:e.alias,modules:[o.nodeModules,o.pnpmNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:[e.overrideResolve&&new n(C),...e.resolvePlugins].filter(Boolean),preferAbsolute:!0,cache:!0,fallback:{}},externals:e.externals,output:outputConfig};
1
+ import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as a}from"./paths.mjs";import n from"./plugin/override-resolve.mjs";import s from"./plugins.config.mjs";import{NODE_ENV as i,PACKAGENAME as l,PACKAGEVERSION as r,isDev as m,isLibrary as p}from"./process-env.mjs";import{isObject as c,node_modules as u,resolveProgram as h}from"./utils/index.mjs";import{join as d,resolve as f,extname as g}from"path";import{exampleModuleName as b}from"./vm/example.mjs";import y from"./vm/info.mjs";export const outputConfig={path:h(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${m?"name":"contenthash"}].js`,assetModuleFilename:e=>{let t=g(e.filename||"").substring(1);return`assets/${t}/[name][hash][ext]`},library:{name:`${y.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${l}`,pathinfo:m,clean:!0,publicPath:t,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"anonymous",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let j={main:[e.polyfill&&d(o.corePath,"./polyfills/replace-children.mjs"),u("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?j={main:[e.entry]}:Object.keys(e.entry)&&(j=Object.assign(j,e.entry))),"string"==typeof j.main&&(j.main=[j.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let v={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,name:`.${[a,i].filter(Boolean).join("-")}`,version:`${r}`,buildDependencies:{config:[o.configPath]}};!1===e.cache?v=!1:c(e.cache)&&(v=Object.assign(v,e.cache));let C=Object.assign({original:e.alias["@"],override:a&&h(a)},e.overrideResolve);export const commonConfig={name:"client",target:"web",devtool:e.devtool,entry:j,mode:m?"development":"production",stats:"errors-only",cache:v,snapshot:{immutablePaths:[/node_modules\/(?!(@app|@moneko)\/)/],managedPaths:[/^@app\/.+/,/^@moneko\/.+/],buildDependencies:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:e.externalsPresets,plugins:s,node:{global:!1,__filename:!1,__dirname:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:e.lazyCompilation&&m&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(u(b))||t.startsWith(u("@app/comment"))||t.startsWith(o.pagesPath)||t.startsWith(o.componentsPath)))}},buildHttp:c(e.buildHttp)?{allowedUris:[],lockfileLocation:f(o.httpCachePath,"http.lock"),cacheLocation:f(o.httpCachePath,"data"),upgrade:!0,...e.buildHttp}:e.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:e.alias,modules:[o.nodeModules,o.pnpmNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:[e.overrideResolve&&new n(C),...e.resolvePlugins].filter(Boolean),preferAbsolute:!0,cache:!0,fallback:{}},externals:e.externals,output:outputConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.24.11",
3
+ "version": "3.24.13",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",