UNPKG

astro-compress

Version:
2 lines (1 loc) 1.39 kB
var c=(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:a})=>`${i("Error:")} Cannot compress file ${e(await o(a))}${i((await import("node:path")).parse(a).base)}`,Passed:async({Before:a,Buffer:t})=>a>s.byteLength(t.toString()),Accomplished:async({Input:a,Before:t,After:f})=>{const r=t-f;return`${e(`(-${(await import("@playform/pipe/Target/Function/Bytes.js")).default(r)})`)} ${(await import("kleur/colors")).green(`${(r/t*100).toFixed(2)}%`)} reduction in ${e(await o(a))}${(await import("kleur/colors")).cyan((await import("node:path")).parse(a).base)}`},Changed:async a=>Object.defineProperty(a.Info,"Total",{value:(a.Info.Total?a.Info.Total:0)+(a.On.Before-a.On.After),configurable:!0,writable:!0})&&a}});const{gray:e,red:i}=await import("kleur/colors"),{default:o}=await import("../Function/Directory.js"),{Buffer:s}=await import("node:buffer");export{c as default};