Skip to content

Commit

Permalink
fix: correctly pass SVGO Options (#129)
Browse files Browse the repository at this point in the history
* fix: correctly pass svgo options

* Create violet-experts-travel.md

---------

Co-authored-by: Michael Stramel <[email protected]>
  • Loading branch information
2 people authored and natemoo-re committed Dec 21, 2023
1 parent 65e0164 commit 2288522
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-experts-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro-icon": patch
---

fix: correctly pass SVGO Options
4 changes: 2 additions & 2 deletions packages/core/src/vite-plugin-astro-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AstroConfig, "root">
): Promise<Plugin> {
const virtualModuleId = "virtual:astro-icon";
Expand All @@ -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
Expand Down

0 comments on commit 2288522

Please sign in to comment.