Skip to content

New SVG icons are not added to spritemap in dev mode until server restart #96

@Don-aks

Description

@Don-aks

In development mode, newly added SVG icons are not picked up by the spritemap automatically.
The icons only appear in the generated spritemap after manually restarting the Vite dev server.

This breaks the expected hot-reload workflow and makes iterative work with icons inconvenient.

Steps to Reproduce

  1. Start Vite dev server.
  2. Ensure @spiriit/vite-plugin-svg-spritemap is configured and working.
  3. Open the application in the browser and verify that existing icons are rendered correctly.
  4. Add a new SVG file to the icons directory (e.g. src/assets/icons/new-icon.svg).
  5. Try to use the new icon in the markup (e.g. ).
  6. Observe that the icon is not available in the spritemap.
  7. Restart the dev server.
  8. Observe that the icon now appears and works as expected.

Expected Behavior

Newly added SVG files should be automatically detected in dev mode and added to the spritemap without requiring a full server restart.

Actual Behavior

New icons are ignored until the dev server is manually restarted.

Environment

Vite: 7.1.7
@spiriit/vite-plugin-svg-spritemap: 6.0.0
OS: Windows 11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions