Skip to content

Commit

Permalink
Avoid stale closure on dev restart (#203)
Browse files Browse the repository at this point in the history
* fix(#181): avoid closure

* chore: add changeset
  • Loading branch information
natemoo-re authored Feb 7, 2024
1 parent f69a175 commit a4ff873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rare-bugs-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro-icon": patch
---

Fixes an issue where collections would not be updated when the dev server was automatically restarted
2 changes: 1 addition & 1 deletion packages/core/src/vite-plugin-astro-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ interface PluginContext extends Pick<AstroConfig, "root" | "output"> {
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;
Expand Down

0 comments on commit a4ff873

Please sign in to comment.