nuxt / nuxt/icon

Too much duplicated characters if use a same svg icon many times in one page

Open
#66 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
96
Avg merge
8h 12m
Merged PRs (30d)
2

Description

This nuxt-icon module works well in my nuxt3 project, but I found a small problem:

I have 100 pictures on my home page, then I put such as 'edit' icon and 'love' icon on every pictures , which turn out to be many duplicated characters on the page because of the path of every svg is very long but they are same <path>.

Could it be possible to use <use> to resolve that problem for ssr when building?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Nuxt icon module renders repeated SVG icons during SSR, especially how each icon's path is serialized into the page. Determine whether repeated paths can be referenced with while preserving the existing icon output. Done means repeated identical icons no longer duplicate the long path data in the SSR-rendered page.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.