From d6dfcc0b254c82b80e77e6b92d666294507eeeae Mon Sep 17 00:00:00 2001 From: dangreen Date: Wed, 2 Sep 2026 16:32:53 +0400 Subject: [PATCH] docs: correct the fallback wording and the install commands The `format` order decides the fallback only when the source format is not in the list, so a jpg source with `["avif", "jpg"]` still hands out the jpg. `@srcset/runtime` is a peer dependency that ships to the browser, so the plugin and the loader install it as a regular one rather than a dev one. The component packages link to the single `/components/` page, and `@srcset/bundler-utils` to the site root: it is internal to the integrations and has no page of its own. --- packages/bundler-utils/README.md | 2 +- packages/loader/README.md | 13 +++++++++---- packages/preact/README.md | 2 +- packages/react/README.md | 2 +- packages/svelte/README.md | 2 +- packages/vite-plugin/README.md | 13 +++++++++---- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/packages/bundler-utils/README.md b/packages/bundler-utils/README.md index e558f8b..82f953c 100644 --- a/packages/bundler-utils/README.md +++ b/packages/bundler-utils/README.md @@ -58,4 +58,4 @@ You probably need [@srcset/loader](https://npmjs.com/package/@srcset/loader) or ## Documentation -For more details, guides and API references, check out the [documentation website](https://srcset.js.org/api/bundler-utils/). +For more details, guides and API references, check out the [documentation website](https://srcset.js.org). diff --git a/packages/loader/README.md b/packages/loader/README.md index 1cb0805..fe42680 100644 --- a/packages/loader/README.md +++ b/packages/loader/README.md @@ -40,13 +40,18 @@ ```bash # pnpm -pnpm add -D @srcset/loader @srcset/runtime +pnpm add -D @srcset/loader +pnpm add @srcset/runtime # yarn -yarn add -D @srcset/loader @srcset/runtime +yarn add -D @srcset/loader +yarn add @srcset/runtime # npm -npm i -D @srcset/loader @srcset/runtime +npm i -D @srcset/loader +npm i @srcset/runtime ``` +`@srcset/runtime` is a peer dependency that ships to the browser, so it goes into the regular dependencies while the loader stays a dev one. + ## Usage ```js @@ -60,7 +65,7 @@ export default { loader: '@srcset/loader', options: { rules: [ - // First format is the fallback: default export and src + // Keep jpg in the list: it is what a browser without webp or avif gets { width: [1, 0.5], format: ['jpg', 'webp', 'avif'] diff --git a/packages/preact/README.md b/packages/preact/README.md index cc7ddc5..043f205 100644 --- a/packages/preact/README.md +++ b/packages/preact/README.md @@ -68,4 +68,4 @@ function Hero() { ## Documentation -For more details, guides and API references, check out the [documentation website](https://srcset.js.org/components/preact/). +For more details, guides and API references, check out the [documentation website](https://srcset.js.org/components/). diff --git a/packages/react/README.md b/packages/react/README.md index 739c5c3..125bb2d 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -68,4 +68,4 @@ function Hero() { ## Documentation -For more details, guides and API references, check out the [documentation website](https://srcset.js.org/components/react/). +For more details, guides and API references, check out the [documentation website](https://srcset.js.org/components/). diff --git a/packages/svelte/README.md b/packages/svelte/README.md index b0a637b..7781db4 100644 --- a/packages/svelte/README.md +++ b/packages/svelte/README.md @@ -66,4 +66,4 @@ npm i @srcset/svelte @srcset/runtime ## Documentation -For more details, guides and API references, check out the [documentation website](https://srcset.js.org/components/svelte/). +For more details, guides and API references, check out the [documentation website](https://srcset.js.org/components/). diff --git a/packages/vite-plugin/README.md b/packages/vite-plugin/README.md index fd50341..f583b67 100644 --- a/packages/vite-plugin/README.md +++ b/packages/vite-plugin/README.md @@ -40,13 +40,18 @@ Vite plugin for generating responsive images. ```bash # pnpm -pnpm add -D @srcset/vite-plugin @srcset/runtime +pnpm add -D @srcset/vite-plugin +pnpm add @srcset/runtime # yarn -yarn add -D @srcset/vite-plugin @srcset/runtime +yarn add -D @srcset/vite-plugin +yarn add @srcset/runtime # npm -npm i -D @srcset/vite-plugin @srcset/runtime +npm i -D @srcset/vite-plugin +npm i @srcset/runtime ``` +`@srcset/runtime` is a peer dependency that ships to the browser, so it goes into the regular dependencies while the plugin stays a dev one. + ## Usage ```js @@ -58,7 +63,7 @@ export default defineConfig({ plugins: [ srcset({ rules: [ - // First format is the fallback: default export and src + // Keep jpg in the list: it is what a browser without webp or avif gets { match: '**/*.jpg', width: [1, 0.5],