@moneko/core 3.34.4 → 3.34.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.
- package/lib/build.mjs +1 -1
- package/package.json +1 -1
package/lib/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as o}from"node:path";import{analyzeBundleSize as r,completedInfo as m,ink as
|
|
1
|
+
import{relative as o}from"node:path";import{analyzeBundleSize as r,completedInfo as m,ink as t,println as e,progressBar as i}from"@moneko/utils";import s from"webpack";import{merge as n}from"webpack-merge";import a from"./build/common.mjs";import p from"./commom/paths.mjs";import l from"./plugin/done.mjs";import{empty as u}from"./utils/index.mjs";import c from"./utils/seo.mjs";import{CONFIG as g}from"./config.mjs";import f from"./module.config.mjs";let d=n(a,{module:f(!1),plugins:[]});if(g.done&&d.plugins.push(new l({done:g.done})),g.bar){let o=g.bar,r=o.name||"Build";d.plugins.push(new s.ProgressPlugin({handler(m,t,...e){let s=e.length?`[${t}] ${e.join(" ")}`:"";o.quiet?process.stdout.write(s):(i(m||0,1,{msg:s,name:r,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===m&&process.stdout.write("\r\x1b[2K"))}}))}let h=s(d);async function w(){let i=await new Promise((o,r)=>{h.run((m,t)=>{m&&r(m),t?o(t):r(Error("编译过程中没有生成统计信息"))})});(i.hasErrors()||i.hasWarnings())&&function(o){let{warnings:r,errors:m}=o.compilation;r.forEach(o=>{e(t(o.message,"178"))}),m.forEach(o=>{e(t(o.message,"red"))})}(i),await new Promise(s=>{i.compilation.compiler.cache.shutdown(n=>{n&&e(t(n.toString(),"red")),r(i.compilation.outputOptions.path,["\\.js$"]),m(~~((i.endTime-i.startTime)/10)/100,o(p.programPath,i.compilation.outputOptions.path)),s()})}),g.seo&&c()}process.on("exit",u),await w();
|