@moneko/core 3.15.19 → 3.16.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/build.mjs +1 -1
- package/lib/utils/progress.d.mts +1 -1
- package/lib/utils/progress.mjs +1 -2
- package/package.json +1 -1
package/lib/build/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as m}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{commonConfig as o}from"../common.mjs";import{CONFIG as t}from"../config.mjs";import{getMinifyOption as
|
|
1
|
+
import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as m}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{commonConfig as o}from"../common.mjs";import{CONFIG as t}from"../config.mjs";import{getMinifyOption as l}from"../options/js-minify.mjs";import{LightningCssMinifyPlugin as p}from"../plugin/lightningcss-plugin.mjs";let{optimize:{MinChunkSizePlugin:s}}=n,a=[];t.minifier&&(a.push(new i(l(t.minifier.type,t.minifier.options))),a.push(new p));let u=r(o,{plugins:[new e({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",ignoreOrder:!0}),t.splitChunk&&new s({minChunkSize:1e4}),t.bundleAnalyzer&&new m({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...t.bundleAnalyzer})].filter(Boolean),optimization:{splitChunks:t.splitChunk,runtimeChunk:t.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!0,minimize:!0,minimizer:a}});export default u;
|
package/lib/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as o}from"@moneko/mdx";import r from"webpack";import{merge as m}from"webpack-merge";import t from"./build/common.mjs";import e from"./build/server.mjs";import{CONFIG as i}from"./config.mjs";import s from"./module.config.mjs";import n from"./paths.mjs";import l from"./plugin/done.mjs";import{SSR as a}from"./process-env.mjs";import p from"./utils/log.mjs";import f from"./utils/seo.mjs";import c from"./utils/progress.mjs";import g from"chalk";let{ProgressPlugin:h}=r,u=
|
|
1
|
+
import{removeDirAll as o}from"@moneko/mdx";import r from"webpack";import{merge as m}from"webpack-merge";import t from"./build/common.mjs";import e from"./build/server.mjs";import{CONFIG as i}from"./config.mjs";import s from"./module.config.mjs";import n from"./paths.mjs";import l from"./plugin/done.mjs";import{SSR as a}from"./process-env.mjs";import p from"./utils/log.mjs";import f from"./utils/seo.mjs";import c from"./utils/progress.mjs";import g from"chalk";let{ProgressPlugin:h}=r,u=m(t,{module:s(!1),plugins:[i.done&&new l({done:i.done}),i.bar&&new h({handler(o,r,...m){let t=i.bar;c(o,t.name||"Build",m.length?`[${r}] ${m.join(" ")}`:"",t.color,u.output?.path)}})].filter(Boolean)}),d=[u];a&&d.push(m(t,e));let j=r(d);async function w(){await new Promise(o=>{j.run((r,m)=>{if(r)throw r;if(m&&(m.hasErrors()||m.hasWarnings()))for(let o=0,r=m.stats.length;o<r;o++){let r=m.stats[o];for(let o=0,m=r.compilation.warnings.length;o<m;o++)p(g.yellowBright(r.compilation.warnings[o].message));for(let o=0,m=r.compilation.errors.length;o<m;o++)p(g.redBright(r.compilation.errors[o].message))}o(r)})}),i.seo&&f()}await w(),process.on("exit",function(){o(n.cachePath),o(n.vfsDtsPath)});
|
package/lib/utils/progress.d.mts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @param {String} info 详细信息
|
|
6
6
|
* @constructor
|
|
7
7
|
*/
|
|
8
|
-
declare function progress(num: number | undefined, title: string, info: string, color?: string): void;
|
|
8
|
+
declare function progress(num: number | undefined, title: string, info: string, color?: string, output?: string): void;
|
|
9
9
|
export default progress;
|
package/lib/utils/progress.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
${s(u)}`;0===c&&process.stdout.write("\n\n"),e.cursorTo(process.stdout,0,n),e.clearScreenDown(process.stdout),process.stdout.write(f),1===c&&(e.cursorTo(process.stdout,0,n),e.clearScreenDown(process.stdout))}
|
|
1
|
+
import{cursorTo as t,clearScreenDown as s}from"readline";import{relative as o}from"path";import e from"chalk";import r from"./log.mjs";import i from"../paths.mjs";import{isDev as p}from"../process-env.mjs";let{blue:d,bgBlue:c,grey:m,green:u,yellow:l,red:f}=e,a={};export default function(n=0,h,$,w,x="dist/"){let g=process.stdout.rows-2,j=Math.fround(24*n),b=w?[e.hex(w),e.bgHex(w)]:[d,c],k=b[0](`${h}:`),v=m(`${(100*n).toFixed()}%`),y=b[1](" ".repeat(j))+b[1].inverse(" ".repeat(24-j));if(0===n&&(a[h]=process.hrtime(),process.stdout.write("\n\n")),t(process.stdout,0,g),s(process.stdout),process.stdout.write(`${k} ${y} ${v}`),process.stdout.write("\n"),process.stdout.write(m($.substring(0,100))),1===n){if(!p){let t=process.hrtime(a[h]),s=t[0]+t[1]/1e9,e=u;s<10?e=u:s<20?e=l:s<40&&(e=f),r(["",m(`Build completed ${u("successfully")}!`),m(`Output files are located in the ${d(`${o(i.programPath,x)}/`)} directory.`),m(`Build took ${e(s.toFixed(2))} seconds.`),"",""])}t(process.stdout,0,g),s(process.stdout)}}
|