Repository navigation
Conversation
buildFiles() returns the set as bytes and build() writes what it returns. The content-addressed cache moves from the Astro integration to vite/cache.mjs, with slot read and write beside the key, and the key now canonicalises vars given as a Map, which the merged options are.
manifestIcons() in lib/core.mjs lists the manifest's icon entries, and manifestJson writes the same bytes from it. favconIcons() hands them to vite-plugin-pwa's manifest.icons, which has no public API for another plugin to fill.
favcon/vite builds through the shared cache, emits the set at the output root in the client environment of a real build only, links it in index.html unless the page declares an icon, and exports links and files from virtual:favcon. A different file of the same name in public/ fails the build before dist/ is emptied. With vite-plugin-pwa present favcon leaves the manifest to it and warns about its pwaAssets. Settings are kept per mode, so a dev-mode server in the same process never decides the release bytes.
The dev server builds the set in fast mode on the first request for an icon and serves it from memory at base with its content type. A different file in public/ is served instead, with a warning. Editing the mark or the config file rebuilds, invalidates virtual:favcon and reloads the page; a broken mark is logged and the page keeps working.
The tarball carries vite/, exports maps ./vite with a types condition, and vite ^8 is an optional peer dependency. The types reject out and unknown keys.
The README gains a Vite section with the vite-plugin-pwa recipe; the CHANGELOG and the definition of done follow.
Deploying favcon with
|
| Latest commit: |
8224301
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5442a3eb.favcon.pages.dev |
| Branch Preview URL: | https://feat-vite.favcon.pages.dev |
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.
Step 3 of the single-engine design:
favseed/vite, a Vite 8 plugin.What it does. In dev the set is built on the first request for an icon, in fast mode, and served from memory at Vite's
basewith its content type; editing the mark orfavseed.config.*rebuilds it, invalidatesvirtual:favseedand reloads the page.vite buildemits the release set at the output root and links it inindex.html, unless the page already declares an icon (rel="icon"orrel="shortcut icon").virtual:favseedexports{ links, files }for frameworks without anindex.html. Options are the config keys minusout, overfavseed.config.*in the Vite root.What I measured first, in scratch projects on Vite 8.3.1 and Astro 7.3.5:
dist/for a plain or static Astro build and indist/client/for@astrojs/node, where the node server serves them. Emitting everywhere leaves dead copies indist/server/, and Astro also runs a dev-mode server insideastro build, so settings are kept per mode: dev's fast mode never decides the release bytes.public/file of the same name without a word, in build and in dev. favseed checks it itself: a different file fails the build inbuildStart, beforedist/is emptied (ingenerateBundlethe failure left a gutteddist/); dev serves your file and warns.configureServeritself; as a post hook,public/and Astro's router answer first.vite.configcannot import a virtual module. So favseed leaves the manifest to it (nosite.webmanifest, no second link), warns about itspwaAssetsgenerator, and exports a synchronousfavseedIcons()for itsmanifest.icons. I ran the README recipe against the real vite-plugin-pwa: itsmanifest.webmanifestlists favseed's 192 and 512 icons asany maskable, and the page carries one manifest link.Shared pieces.
buildFiles()is the in-memory half ofbuild(). The content-addressed cache moves from the Astro integration tovite/cache.mjs, which both use; its key now canonicalisesvarsgiven as aMap, which the merged options are (Object.entriesof aMapis empty, and the key would have dropped every--var).manifestIcons()inlib/core.mjsfeeds bothmanifestJson(same bytes, pinned by a test) andfavseedIcons().Package.
vite/ships,exports["./vite"]has atypescondition,vite ^8.0.0is an optional peer, andvite 8.3.1is the test dependency.Verified locally:
pnpm test, 190 pass, 0 fail, 0 skipped, including a real Vite build and dev server per case and a TypeScript check of avite.config.CI: every job green,
same-bytesincluded, and the 66 Linux hashes are identical to the ones step 1 recorded: no output byte changed.