From 2288522eb0c41f339a55d90a00a82cbc4b8cf2cb Mon Sep 17 00:00:00 2001 From: Michael Stramel Date: Wed, 11 Oct 2023 00:35:18 -0500 Subject: [PATCH] fix: correctly pass SVGO Options (#129) * fix: correctly pass svgo options * Create violet-experts-travel.md --------- Co-authored-by: Michael Stramel --- .changeset/violet-experts-travel.md | 5 +++++ packages/core/src/vite-plugin-astro-icon.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/violet-experts-travel.md diff --git a/.changeset/violet-experts-travel.md b/.changeset/violet-experts-travel.md new file mode 100644 index 00000000..46146489 --- /dev/null +++ b/.changeset/violet-experts-travel.md @@ -0,0 +1,5 @@ +--- +"astro-icon": patch +--- + +fix: correctly pass SVGO Options diff --git a/packages/core/src/vite-plugin-astro-icon.ts b/packages/core/src/vite-plugin-astro-icon.ts index a4499559..ef4a7e85 100644 --- a/packages/core/src/vite-plugin-astro-icon.ts +++ b/packages/core/src/vite-plugin-astro-icon.ts @@ -9,7 +9,7 @@ import loadLocalCollection from "./loaders/loadLocalCollection.js"; import loadIconifyCollections from "./loaders/loadIconifyCollections.js"; export async function createPlugin( - { include = {}, iconDir = "src/icons" }: IntegrationOptions, + { include = {}, iconDir = "src/icons", svgoOptions }: IntegrationOptions, { root }: Pick ): Promise { const virtualModuleId = "virtual:astro-icon"; @@ -30,7 +30,7 @@ export async function createPlugin( if (id === resolvedVirtualModuleId) { try { // Attempt to create local collection - const local = await loadLocalCollection(iconDir); + const local = await loadLocalCollection(iconDir, svgoOptions); collections["local"] = local; } catch (ex) { // Failed to load the local collection