From ee329e830f59606c0edd84ca87b68543087085df Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Fri, 2 Feb 2024 14:03:37 -0600 Subject: [PATCH 1/2] fix(#181): avoid closure --- packages/core/src/vite-plugin-astro-icon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/vite-plugin-astro-icon.ts b/packages/core/src/vite-plugin-astro-icon.ts index 60d4ee4..0febd52 100644 --- a/packages/core/src/vite-plugin-astro-icon.ts +++ b/packages/core/src/vite-plugin-astro-icon.ts @@ -14,11 +14,11 @@ interface PluginContext extends Pick { logger: AstroIntegrationLogger; } -let collections: AstroIconCollectionMap | undefined; export function createPlugin( { include = {}, iconDir = "src/icons", svgoOptions }: IntegrationOptions, ctx: PluginContext, ): Plugin { + let collections: AstroIconCollectionMap | undefined; const { root } = ctx; const virtualModuleId = "virtual:astro-icon"; const resolvedVirtualModuleId = "\0" + virtualModuleId; From 18571097dc92705c92e202f0d642a08e4b7ae045 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Fri, 2 Feb 2024 14:04:26 -0600 Subject: [PATCH 2/2] chore: add changeset --- .changeset/rare-bugs-yawn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rare-bugs-yawn.md diff --git a/.changeset/rare-bugs-yawn.md b/.changeset/rare-bugs-yawn.md new file mode 100644 index 0000000..f1c141a --- /dev/null +++ b/.changeset/rare-bugs-yawn.md @@ -0,0 +1,5 @@ +--- +"astro-icon": patch +--- + +Fixes an issue where collections would not be updated when the dev server was automatically restarted