From b06977675dcd4bbda75a6e6eed833ecdd79499be Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Tue, 28 Oct 2025 21:01:24 +0300 Subject: [PATCH 1/9] feat: add experimetal svgo docs --- astro.sidebar.ts | 1 + .../en/reference/experimental-flags/svg.mdx | 187 ++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 src/content/docs/en/reference/experimental-flags/svg.mdx diff --git a/astro.sidebar.ts b/astro.sidebar.ts index 5392673a160ac..18155498f9d1e 100644 --- a/astro.sidebar.ts +++ b/astro.sidebar.ts @@ -152,6 +152,7 @@ export const sidebar = [ 'reference/experimental-flags/static-import-meta-env', 'reference/experimental-flags/chrome-devtools-workspace', 'reference/experimental-flags/fail-on-prerender-conflict', + 'reference/experimental-flags/svg', ], }), 'reference/legacy-flags', diff --git a/src/content/docs/en/reference/experimental-flags/svg.mdx b/src/content/docs/en/reference/experimental-flags/svg.mdx new file mode 100644 index 0000000000000..0d48613d0ceec --- /dev/null +++ b/src/content/docs/en/reference/experimental-flags/svg.mdx @@ -0,0 +1,187 @@ +--- +title: Experimental SVG optimization +sidebar: + label: SVG optimization +i18nReady: true +--- + +import Since from '~/components/Since.astro' + +

+ +**Type:** `object`
+**Default:** `undefined`
+ +

+ +This experimental feature enables automatic optimization of SVG assets using [SVGO](https://svgo.dev/) during build time. + +When enabled, all imported SVG files will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code. + +To enable this feature, add the experimental flag in your Astro config: + +```js title="astro.config.mjs" ins={4-8} +import { defineConfig } from "astro/config" + +export default defineConfig({ + experimental: { + svg: { + optimize: true + } + } +}) +``` + +## Configuration + +### `optimize` + +**Type:** `boolean`
+**Default:** `true` + +Whether to enable SVG optimization using SVGO during build time. + +When enabled, all imported SVG files will be optimized for smaller file sizes and better performance while maintaining visual quality. + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true + } + } +}) +``` + +### `svgoConfig` + +**Type:** `Config` (SVGO configuration object)
+**Default:** `{}` + +Configuration object passed directly to SVGO for customizing SVG optimization. + +See [SVGO documentation](https://svgo.dev/docs/preset-default/) for available options and plugins. + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true, + svgoConfig: { + plugins: [ + 'preset-default', + { + name: 'removeViewBox', + active: false + } + ] + } + } + } +}) +``` + +## Usage + +Once enabled, SVG optimization will automatically apply to all SVG files imported in your project: + +```astro title="src/pages/index.astro" +--- +import Logo from '../assets/logo.svg'; +--- + + +``` + +The SVG will be optimized during the build process, resulting in smaller file sizes in your production build. + +## Common use cases + +### Preserve specific attributes + +You may want to preserve certain SVG attributes that SVGO removes by default: + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true, + svgoConfig: { + plugins: [ + 'preset-default', + { + name: 'removeViewBox', + active: false // Preserve viewBox attribute + } + ] + } + } + } +}) +``` + +### Remove specific elements + +Remove unwanted elements like metadata or hidden layers: + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true, + svgoConfig: { + plugins: [ + 'preset-default', + { + name: 'removeHiddenElems', + active: true + } + ] + } + } + } +}) +``` + +### Custom precision + +Control the precision of numeric values in path data: + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true, + svgoConfig: { + floatPrecision: 2 + } + } + } +}) +``` + +## Error handling + +If SVGO optimization fails for any reason, Astro will gracefully fall back to using the original, unoptimized SVG content. A warning will be logged to the console, but your build will continue without errors. + +## Performance considerations + +SVG optimization happens during the build process, not at runtime. This means: + +- **Development:** SVGs are not optimized during development for faster rebuild times +- **Production:** All SVGs are optimized once during the build +- **No runtime overhead:** Optimized SVGs are served as static assets + +The optimization process can increase build times slightly, but results in smaller file sizes and faster page loads for your users. + +## Migration notes + +This feature is experimental and may have breaking changes in future versions. When this feature becomes stable: + +- The `experimental.svg` configuration will move to a top-level `svg` configuration +- Default behavior may change based on community feedback + +## Further reading + +- [SVGO documentation](https://svgo.dev/) +- [SVGO preset-default plugins](https://svgo.dev/docs/preset-default/) From 81749d70e3031134ce161535977fe817e4869463 Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Thu, 30 Oct 2025 03:02:32 +0300 Subject: [PATCH 2/9] refactor: make fixes by review --- astro.sidebar.ts | 2 +- .../{svg.mdx => svg-optimization.mdx} | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) rename src/content/docs/en/reference/experimental-flags/{svg.mdx => svg-optimization.mdx} (84%) diff --git a/astro.sidebar.ts b/astro.sidebar.ts index 18155498f9d1e..2a6475deebcfd 100644 --- a/astro.sidebar.ts +++ b/astro.sidebar.ts @@ -152,7 +152,7 @@ export const sidebar = [ 'reference/experimental-flags/static-import-meta-env', 'reference/experimental-flags/chrome-devtools-workspace', 'reference/experimental-flags/fail-on-prerender-conflict', - 'reference/experimental-flags/svg', + 'reference/experimental-flags/svg-optimization', ], }), 'reference/legacy-flags', diff --git a/src/content/docs/en/reference/experimental-flags/svg.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx similarity index 84% rename from src/content/docs/en/reference/experimental-flags/svg.mdx rename to src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index 0d48613d0ceec..6c7445c210d05 100644 --- a/src/content/docs/en/reference/experimental-flags/svg.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -164,22 +164,15 @@ export default defineConfig({ If SVGO optimization fails for any reason, Astro will gracefully fall back to using the original, unoptimized SVG content. A warning will be logged to the console, but your build will continue without errors. -## Performance considerations +## How it works -SVG optimization happens during the build process, not at runtime. This means: +SVG optimization happens during the build process, not at runtime: -- **Development:** SVGs are not optimized during development for faster rebuild times -- **Production:** All SVGs are optimized once during the build -- **No runtime overhead:** Optimized SVGs are served as static assets +- In **development mode**, SVG files are not optimized to ensure faster rebuild times and a smoother development experience. +- In **production builds**, all imported SVG files are optimized once during the build process, resulting in smaller file sizes. +- There is **no runtime overhead** - optimized SVGs are served as pre-processed static assets. -The optimization process can increase build times slightly, but results in smaller file sizes and faster page loads for your users. - -## Migration notes - -This feature is experimental and may have breaking changes in future versions. When this feature becomes stable: - -- The `experimental.svg` configuration will move to a top-level `svg` configuration -- Default behavior may change based on community feedback +While the optimization process may slightly increase your build times, the result is smaller file sizes and faster page loads for your users. ## Further reading From 4fc5050c516169ddf198d42119c7f882fa3780e4 Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Thu, 30 Oct 2025 20:22:40 +0300 Subject: [PATCH 3/9] refactor: make fixes by review --- .../experimental-flags/svg-optimization.mdx | 89 ++++++++++++++----- 1 file changed, 67 insertions(+), 22 deletions(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index 6c7445c210d05..0bac5de3e0c53 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -14,9 +14,9 @@ import Since from '~/components/Since.astro'

-This experimental feature enables automatic optimization of SVG assets using [SVGO](https://svgo.dev/) during build time. +This experimental feature enables automatic optimization of your [SVG components](/en/guides/images/#svg-components) using [SVGO](https://svgo.dev/) during build time. -When enabled, all imported SVG files will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code. +When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code. To enable this feature, add the experimental flag in your Astro config: @@ -32,6 +32,24 @@ export default defineConfig({ }) ``` +## Usage + +No change to using SVG components is required to take advantage of this feature. With experimental `svg.optimization` enabled, all your SVG component import files will be automatically optimized: + +```astro title="src/pages/index.astro" +--- +import Logo from '../assets/logo.svg'; +--- + + +``` + +The SVG will be optimized during the build process, resulting in smaller file sizes in your production build. + +If SVGO optimization fails for any reason, Astro will gracefully fall back to using the original, unoptimized SVG content. A warning will be logged to the console, but your build will continue without errors. + +Note that this optimization applies to every SVG component import in your project. It is not possible to opt out on a per-component basis. + ## Configuration ### `optimize` @@ -41,7 +59,7 @@ export default defineConfig({ Whether to enable SVG optimization using SVGO during build time. -When enabled, all imported SVG files will be optimized for smaller file sizes and better performance while maintaining visual quality. +When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. ```js title="astro.config.mjs" export default defineConfig({ @@ -58,9 +76,7 @@ export default defineConfig({ **Type:** `Config` (SVGO configuration object)
**Default:** `{}` -Configuration object passed directly to SVGO for customizing SVG optimization. - -See [SVGO documentation](https://svgo.dev/docs/preset-default/) for available options and plugins. +This allows you to further control Astro's SVG optimization with [SVGO plugins](https://svgo.dev/docs/plugins/). ```js title="astro.config.mjs" export default defineConfig({ @@ -81,25 +97,59 @@ export default defineConfig({ }) ``` -## Usage +#### `plugins` -Once enabled, SVG optimization will automatically apply to all SVG files imported in your project: +**Type:** `Array`
+**Default:** `[]` -```astro title="src/pages/index.astro" ---- -import Logo from '../assets/logo.svg'; ---- +An array of [SVGO plugins](https://svgo.dev/docs/plugins/) that will be used to optimize your SVG component imports. - +This can include any plugins by ID name, including SVGO's `preset-default` collection of plugins. A plugin can optionally be passed as an object including both its `name` and `active` status, to enable or disable as necessary. + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true, + svgoConfig: { + plugins: [ + 'preset-default', + { + name: 'removeViewBox', + active: false + } + ] + } + } + } +}) ``` -The SVG will be optimized during the build process, resulting in smaller file sizes in your production build. +#### Other configuration options + +You can also pass [other SVGO configuration options](https://svgo.dev/docs/configuration/), such as `floatPrecision` and `multipass`, directly to your config object: + +```js title="astro.config.mjs" +export default defineConfig({ + experimental: { + svg: { + optimize: true, + svgoConfig: { + floatPrecision: 2, + multipass: true + } + } + } +}) +``` ## Common use cases +SVGO provides an extensive [default plugin list](https://svgo.dev/docs/preset-default/) with opinionated optimizations that is more convenient than adding each plugin individually. However, you may need to customize it further for your needs. For example, it may remove items or clean up too aggressively for your situation. + ### Preserve specific attributes -You may want to preserve certain SVG attributes that SVGO removes by default: +You may want to preserve certain SVG attributes, such as the `viewBox`, that SVGO removes by default: ```js title="astro.config.mjs" export default defineConfig({ @@ -122,7 +172,7 @@ export default defineConfig({ ### Remove specific elements -Remove unwanted elements like metadata or hidden layers: +You can configure plugins to remove specific unwanted elements like metadata or hidden layers. Note that many plugins are already included in `preset-default`, so you typically only need to configure their behavior: ```js title="astro.config.mjs" export default defineConfig({ @@ -133,7 +183,7 @@ export default defineConfig({ plugins: [ 'preset-default', { - name: 'removeHiddenElems', + name: 'removeMetadata', active: true } ] @@ -160,10 +210,6 @@ export default defineConfig({ }) ``` -## Error handling - -If SVGO optimization fails for any reason, Astro will gracefully fall back to using the original, unoptimized SVG content. A warning will be logged to the console, but your build will continue without errors. - ## How it works SVG optimization happens during the build process, not at runtime: @@ -177,4 +223,3 @@ While the optimization process may slightly increase your build times, the resul ## Further reading - [SVGO documentation](https://svgo.dev/) -- [SVGO preset-default plugins](https://svgo.dev/docs/preset-default/) From 4ed24b9bf9b70c78e9a22794c4111def18d5893e Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Fri, 31 Oct 2025 20:33:08 +0300 Subject: [PATCH 4/9] fix: fix svgo configuration link --- .../docs/en/reference/experimental-flags/svg-optimization.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index 0bac5de3e0c53..b010b2f0bcbab 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -127,7 +127,7 @@ export default defineConfig({ #### Other configuration options -You can also pass [other SVGO configuration options](https://svgo.dev/docs/configuration/), such as `floatPrecision` and `multipass`, directly to your config object: +You can also pass [other SVGO configuration options](https://github.com/svg/svgo#configuration), such as `floatPrecision` and `multipass`, directly to your config object: ```js title="astro.config.mjs" export default defineConfig({ From 30058998ef7191816cdd0cad26074d56449c4bb1 Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Fri, 31 Oct 2025 20:51:29 +0300 Subject: [PATCH 5/9] feat: use new svgo config format --- .../experimental-flags/svg-optimization.mdx | 136 ++++++------------ 1 file changed, 46 insertions(+), 90 deletions(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index b010b2f0bcbab..a7df35fc048bd 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -9,8 +9,8 @@ import Since from '~/components/Since.astro'

-**Type:** `object`
-**Default:** `undefined`
+**Type:** `boolean | object`
+**Default:** `false`

@@ -18,23 +18,21 @@ This experimental feature enables automatic optimization of your [SVG components When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code. -To enable this feature, add the experimental flag in your Astro config: +To enable this feature with default settings, set it to `true` in your Astro config: -```js title="astro.config.mjs" ins={4-8} +```js title="astro.config.mjs" ins={4} import { defineConfig } from "astro/config" export default defineConfig({ experimental: { - svg: { - optimize: true - } + svgo: true } }) ``` ## Usage -No change to using SVG components is required to take advantage of this feature. With experimental `svg.optimization` enabled, all your SVG component import files will be automatically optimized: +No change to using SVG components is required to take advantage of this feature. With experimental `svgo` enabled, all your SVG component import files will be automatically optimized: ```astro title="src/pages/index.astro" --- @@ -52,52 +50,25 @@ Note that this optimization applies to every SVG component import in your projec ## Configuration -### `optimize` - -**Type:** `boolean`
-**Default:** `true` - -Whether to enable SVG optimization using SVGO during build time. - -When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. - -```js title="astro.config.mjs" -export default defineConfig({ - experimental: { - svg: { - optimize: true - } - } -}) -``` - -### `svgoConfig` - -**Type:** `Config` (SVGO configuration object)
-**Default:** `{}` - -This allows you to further control Astro's SVG optimization with [SVGO plugins](https://svgo.dev/docs/plugins/). +You can pass a [SVGO configuration object](https://svgo.dev/docs/plugins/) to customize optimization behavior: ```js title="astro.config.mjs" export default defineConfig({ experimental: { - svg: { - optimize: true, - svgoConfig: { - plugins: [ - 'preset-default', - { - name: 'removeViewBox', - active: false - } - ] - } + svgo: { + plugins: [ + 'preset-default', + { + name: 'removeViewBox', + active: false + } + ] } } }) ``` -#### `plugins` +### `plugins` **Type:** `Array`
**Default:** `[]` @@ -109,35 +80,29 @@ This can include any plugins by ID name, including SVGO's `preset-default` colle ```js title="astro.config.mjs" export default defineConfig({ experimental: { - svg: { - optimize: true, - svgoConfig: { - plugins: [ - 'preset-default', - { - name: 'removeViewBox', - active: false - } - ] - } + svgo: { + plugins: [ + 'preset-default', + { + name: 'removeViewBox', + active: false + } + ] } } }) ``` -#### Other configuration options +### Other configuration options You can also pass [other SVGO configuration options](https://github.com/svg/svgo#configuration), such as `floatPrecision` and `multipass`, directly to your config object: ```js title="astro.config.mjs" export default defineConfig({ experimental: { - svg: { - optimize: true, - svgoConfig: { - floatPrecision: 2, - multipass: true - } + svgo: { + floatPrecision: 2, + multipass: true } } }) @@ -154,17 +119,14 @@ You may want to preserve certain SVG attributes, such as the `viewBox`, that SVG ```js title="astro.config.mjs" export default defineConfig({ experimental: { - svg: { - optimize: true, - svgoConfig: { - plugins: [ - 'preset-default', - { - name: 'removeViewBox', - active: false // Preserve viewBox attribute - } - ] - } + svgo: { + plugins: [ + 'preset-default', + { + name: 'removeViewBox', + active: false // Preserve viewBox attribute + } + ] } } }) @@ -177,17 +139,14 @@ You can configure plugins to remove specific unwanted elements like metadata or ```js title="astro.config.mjs" export default defineConfig({ experimental: { - svg: { - optimize: true, - svgoConfig: { - plugins: [ - 'preset-default', - { - name: 'removeMetadata', - active: true - } - ] - } + svgo: { + plugins: [ + 'preset-default', + { + name: 'removeMetadata', + active: true + } + ] } } }) @@ -200,11 +159,8 @@ Control the precision of numeric values in path data: ```js title="astro.config.mjs" export default defineConfig({ experimental: { - svg: { - optimize: true, - svgoConfig: { - floatPrecision: 2 - } + svgo: { + floatPrecision: 2 } } }) From a2728a82dec9dde8412baf86f851a7d17ff55386 Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Mon, 3 Nov 2025 13:31:43 +0300 Subject: [PATCH 6/9] refactor: update link to svgo options Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- .../docs/en/reference/experimental-flags/svg-optimization.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index a7df35fc048bd..6ef1160b3bffc 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -95,7 +95,7 @@ export default defineConfig({ ### Other configuration options -You can also pass [other SVGO configuration options](https://github.com/svg/svgo#configuration), such as `floatPrecision` and `multipass`, directly to your config object: +You can also pass [other SVGO configuration options](https://github.com/svg/svgo/blob/66d503a48c6c95661726262a3068053c429b06a9/lib/types.ts#L335), such as `floatPrecision` and `multipass`, directly to your config object: ```js title="astro.config.mjs" export default defineConfig({ From a04876b513011ee4e174339ea71cdb4302f58177 Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Date: Tue, 4 Nov 2025 05:31:17 -0400 Subject: [PATCH 7/9] update version number for the feature --- .../docs/en/reference/experimental-flags/svg-optimization.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index 6ef1160b3bffc..7fe6e2e9632ac 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -11,7 +11,7 @@ import Since from '~/components/Since.astro' **Type:** `boolean | object`
**Default:** `false`
- +

This experimental feature enables automatic optimization of your [SVG components](/en/guides/images/#svg-components) using [SVGO](https://svgo.dev/) during build time. From cbcd2d769d916c390fc8f89ad5e26f7d021cd164 Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Date: Wed, 5 Nov 2025 11:45:23 -0400 Subject: [PATCH 8/9] no fallback; throws error now --- .../docs/en/reference/experimental-flags/svg-optimization.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index 7fe6e2e9632ac..de6a8c153801a 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -44,8 +44,6 @@ import Logo from '../assets/logo.svg'; The SVG will be optimized during the build process, resulting in smaller file sizes in your production build. -If SVGO optimization fails for any reason, Astro will gracefully fall back to using the original, unoptimized SVG content. A warning will be logged to the console, but your build will continue without errors. - Note that this optimization applies to every SVG component import in your project. It is not possible to opt out on a per-component basis. ## Configuration From 553426a090a708a602dc083805718e4fb70cd866 Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Date: Thu, 6 Nov 2025 13:53:16 -0400 Subject: [PATCH 9/9] Armand boss reviews Co-authored-by: Armand Philippot --- .../docs/en/reference/experimental-flags/svg-optimization.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx index de6a8c153801a..6b10040e50a55 100644 --- a/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx +++ b/src/content/docs/en/reference/experimental-flags/svg-optimization.mdx @@ -20,7 +20,7 @@ When enabled, your imported SVG files used as components will be optimized for s To enable this feature with default settings, set it to `true` in your Astro config: -```js title="astro.config.mjs" ins={4} +```js title="astro.config.mjs" ins={5} import { defineConfig } from "astro/config" export default defineConfig({ @@ -48,7 +48,7 @@ Note that this optimization applies to every SVG component import in your projec ## Configuration -You can pass a [SVGO configuration object](https://svgo.dev/docs/plugins/) to customize optimization behavior: +You can pass a [SVGO configuration object](https://github.com/svg/svgo/blob/66d503a48c6c95661726262a3068053c429b06a9/lib/types.ts#L335) to customize optimization behavior: ```js title="astro.config.mjs" export default defineConfig({