DEPRECATED SVGO provides esm module for browsers, compatible with Deno. https://unpkg.com/[email protected]/dist/svgo.browser.js
SVGO fork to make it work in Deno.
import { optimize } from "https://raw.githubusercontent.com/lumeland/svgo/deno/mod.js";
const filepath = "assets/my-logo.svg";
const data = await Deno.readTextFile(filepath);
const result = optimize(data, {
path: filepath,
plugins: [
"cleanupAttrs",
"removeDoctype",
"removeXMLProcInst",
//...
],
});
console.log(result);