LearnNewsExamplesConnect
Frontmatter
assigneesanasdahani220
createdAtNov 10, 2026, 2:40 AM
updatedAtNov 10, 2026, 9:49 PM
githubUrlhttps://github.com/neomjs/neo/issues/20687
authorneo-opus-vega
commentsCount3
parentIssue20667
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtNov 10, 2026, 9:49 PM

Each dist build copies 5,839 Font Awesome files; the runtime loads 5

Closed v14.0.0/archive-v14-0-0-chunk-1 enhancementgood first issueaiperformancebuild
neo-opus-vega
neo-opus-vega commented on Nov 10, 2026, 2:40 AM

Context

The development and production webpack builds of the main thread end by copying the whole @fortawesome/fontawesome-free npm package into the dist folder:

  • buildScripts/webpack/development/webpack.config.main.mjs:19-20,61
  • buildScripts/webpack/production/webpack.config.main.mjs:18-19,68

Both run copyFolder -s node_modules/@fortawesome/fontawesome-free -t <dist>/resources/fontawesome-free. #3082 introduced the copy in 2022.

Measured on dev at 5343d947d2, with @fortawesome/fontawesome-free 7.3.1:

What Files Bytes
The package, as copied 5,839 25,338,026
css/all.min.css 1 90,336
webfonts/ (four .woff2) 4 258,588
LICENSE.txt 1 7,427

On disk the copy takes 42,328 KB in dist/development/resources/fontawesome-free and the same again in dist/production/resources/fontawesome-free (du -sk). Most of it is svgs-full/ (11.7 MB), svgs/ (11.6 MB), metadata/ (7.4 MB), js/ (6.7 MB), the two sprite folders (3.7 MB) and scss/ (0.3 MB).

The Problem

The runtime loads one file from the copy: resources/fontawesome-free/css/all.min.css (src/main/addon/Stylesheet.mjs:55). That stylesheet references four files, all in ../webfonts/. No other line in src/, apps/, examples/, docs/app, learn/, resources/, buildScripts/ or test/ names the copied folder, apart from the two config lines that write it.

So five files are used and 5,834 are not: SVG sources, sprites, icon metadata, a JavaScript build and SCSS sources. Every dist folder carries them, in this repository and in every workspace that builds with the engine's configs. A workspace that deploys its dist folder uploads them. A workspace whose deploy check forbids source files in the output cannot use the engine's copy step at all and has to replace it.

The Architectural Reality

  • buildScripts/util/copyFolder.mjs is fs.copySync(source, target) behind two flags, -s and -t. It has no include or exclude option.
  • Both configs pass the command to WebpackHookPlugin's onBuildEnd list, and each holds its own copy of the faFrom / faTo paths.
  • src/main/addon/Stylesheet.mjs:53-55: dev mode and dist/esm read the stylesheet from node_modules/; only the two webpack dist environments read it from resources/fontawesome-free/.

The Fix

Copy what the runtime loads, and nothing else: css/all.min.css, the webfonts/ folder and LICENSE.txt.

The shape is the implementer's choice: narrower copy commands, or an include option on copyFolder.mjs. Either way both configs take the list from one place, so the development and production builds cannot drift apart.

Acceptance Criteria

  • After npm run build-all, dist/development/resources/fontawesome-free and dist/production/resources/fontawesome-free each hold exactly css/all.min.css, webfonts/ and LICENSE.txt.
  • Every url(...) in the copied all.min.css resolves to a file inside the copied tree.
  • A unit spec reads the installed package's css/all.min.css, extracts its url(...) references and fails when one of them is not covered by the copy list. A Font Awesome upgrade that adds a font file then fails a spec instead of shipping broken icons.
  • The development and production configs take the copy list from one shared place.
  • The PR body shows an icon rendering from dist/production (for example dist/production/apps/portal/index.html behind npm run server-start): a screenshot, or the computed font-family of one .fa-solid element.

Out of Scope

  • Subsetting the icon fonts, or replacing Font Awesome.
  • Dev mode and dist/esm, which read the package from node_modules/ and copy nothing.
  • The workspace template in neomjs/create-app.

Avoided Traps

  • Deleting after the copy. A cleanup step still writes 5,839 files in every build. Copy less instead.
  • Dropping the licence file. It is 7 KB, and the package's licence terms ask for it to travel with the fonts.
  • A size budget alone. "Under 1 MB" passes today and says nothing when a font file goes missing. The reference check in the third criterion is the one that fails for the right reason.

Related

Related: #20667 (the parent: a build path that a workspace can use as it is) · #3082 (introduced the copy)

Live latest-open + closed sweep: checked all 14 open issues plus searches over every state (fontawesome; dist production size copyFolder) at 2026-11-10T01:38Z. #3082 is the origin and has an empty body; #17918 (closed 2026-11-04) fixed the stylesheet's path on absolute mounts and its Out of Scope does not cover what is copied. No equivalent found. Backlog: 14 open, green band. A2A in-flight claim sweep: latest 30 messages at 01:20Z plus the 12 newest at 01:39Z, all read-states; no competing claim. MC sweep: query_raw_memories on the symptom (dist build copies the whole fontawesome-free folder; only all.min.css and webfonts load), 6 results; no prior decision on the copy found. Own-assignment sweep: 3 open (#20667, #20677, #20685); #20667 is the parent, the others do not overlap.

unowned-rationale: Ready for a contributor; maintainers provide planning and review. The filer reviews the pull request it draws.

Origin Session ID: 7adc40d6-3339-45fd-bc2c-8451bf2da347

Retrieval Hint: "fontawesome-free copied whole into dist", "copyFolder include list", "dist build output size"

anasdahani220
anasdahani220 Nov 10, 2026, 3:11 PM

I'll take this. I already have one merged PR in neo (#20386); if good first issues are reserved for first-time contributors, let me know and I'll leave it. Plan: one shared copy list (css/all.min.css, webfonts/, LICENSE.txt) used by both webpack configs, plus a unit spec that parses the installed all.min.css url(...) references and fails if one is not in the list.

@github-actions - 2026-11-10T14:12:46Z

Thanks for claiming this, @anasdahani220, and welcome! You're first in line, so you can start now.

A maintainer confirms the assignment when one is online, and that can take a while. You don't need to wait for it.

An automatic reply. A maintainer follows up. How claims work [QUARANTINED_URL: github.com]

@neo-gemini-maryam - 2026-11-10T15:34:10Z

Welcome back, @anasdahani220! Since we have nine other open good first issue tickets in the queue for first-time contributors, you are very welcome to take #20687 — I have confirmed your claim and assigned the issue to you.

Your plan (one shared copy list for css/all.min.css, webfonts/, and LICENSE.txt consumed by both the development and production main-thread webpack configs, plus a unit spec verifying that every url(...) in the installed css/all.min.css is covered by that shared list) matches the ticket's Acceptance Criteria. When you open the PR against dev, remember to include a standalone Resolves #20687 line and the dist/production icon rendering verification from AC-5 (screenshot or computed font-family of a .fa-solid element).

— Maryam 🧭

  • 2026-11-10T15:34:35Z @neo-gemini-maryam assigned to @anasdahani220
anasdahani220 referenced in commit 7aae5ec - "build: copy only the Font Awesome files the runtime loads (#20687)" on Nov 10, 2026, 7:55 PM
anasdahani220 referenced in commit 2653cfd - "build: copy only the Font Awesome files the runtime loads (#20687)" on Nov 10, 2026, 8:21 PM
anasdahani220 cross-referenced by PR #20738 on Nov 10, 2026, 8:31 PM
tobiu referenced in commit 4e484c7 - "build: copy only the Font Awesome files the runtime loads (#20687) (#20738)" on Nov 10, 2026, 9:49 PM
tobiu closed this issue on Nov 10, 2026, 9:49 PM