nuxt / nuxt/icon

Any way to split clientBundle into smaller chunks?

Open
#286 2 comments 3 reactions 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

My icons bundle size is 1008KB. Mostly because of using icons from the "flags" collection, which is quite heavy.

I don't know if it's feasible, but a way to automatically split the bundled icons into smaller chunk would be awesome. Example in nuxt.config.ts:

icon: {
    clientBundle: {
      icons: iconsToBundle,
      scan: false,
      sizeLimitKb: 1100,
      splitLimitKb: 500, // 500 by default
    }
  },

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 the clientBundle configuration shown in nuxt.config.ts and identify where the icons list is bundled. Determine whether automatic chunking can honor the proposed splitLimitKb while preserving the existing sizeLimitKb behavior. Done should include a documented configuration and a working example for the flags collection.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.