fix: stop shipping unreferenced branding images in store zips - #41
Merged
Conversation
icons/ also holds README branding images (JSON-Alexander.png, json-bonsai.webp); cpSync of the whole directory shipped ~530KB of unreferenced assets in every store zip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
copyStatic()inscripts/build.mjscopied the entireicons/directory intodist/, so every store zip shipped:icons/JSON-Alexander.png— 435 KB, referenced nowhereicons/json-bonsai.webp— 100 KB, README hero image onlyThat was ~80% of the package: 666 KB → 130 KB after this change. AMO reviewers also flag unused files.
Change
Copy only the three icons the manifest references (
icon16/48/128.png) instead of the whole directory. Repo files are untouched — the README still usesicons/json-bonsai.webp.Verification
npm run package→unzip -l json-bonsai-chrome.ziplists exactly: manifest, 3 bundles, content.css, 3 icons (8 files, 130 KB)npm testandnpm run typecheckgreen