UNPKG

astro-compress

Version:
2 lines (1 loc) 1.39 kB
var n=(await import("../Function/Merge.js")).default((await import("@playform/pipe/Target/Variable/Option.js")).default,{CSS:{csso:(await import("./CSS/csso.js")).default,lightningcss:!1},HTML:{"html-minifier-terser":(await import("./HTML/html-minifier-terser.js")).default},JavaScript:{terser:(await import("./JavaScript/terser.js")).default},Image:{sharp:(await import("./Image/sharp.js")).default},SVG:{svgo:(await import("./SVG/svgo.js")).default},JSON:!0,Map:(await import("./Map.js")).default,Parser:(await import("./Parser.js")).default,Action:{Failed:async({Input:t})=>`${r("Error:")} Cannot compress file ${e(await o(t))}${r((await import("node:path")).parse(t).base)}`,Passed:async({Before:t,Buffer:a})=>t>f.byteLength(a.toString()),Accomplished:async({Input:t,Before:a,After:s})=>{const i=a-s;return`${e(`(-${(await import("@playform/pipe/Target/Function/Bytes.js")).default(i)})`)} ${(await import("kleur/colors")).green(`${(i/a*100).toFixed(2)}%`)} reduction in ${e(await o(t))}${(await import("kleur/colors")).cyan((await import("node:path")).parse(t).base)}`},Changed:async t=>Object.defineProperty(t.Info,"Total",{value:(t.Info.Total?t.Info.Total:0)+(t.On.Before-t.On.After),configurable:!0,writable:!0})&&t}});const{gray:e,red:r}=await import("kleur/colors"),{default:o}=await import("../Function/Directory.js"),{Buffer:f}=await import("node:buffer");export{n as default};