Packages

astro

7.4.13 · 18 Nov 2026MIT12.5M / weekRepositoryHomepagenpmAtom feed

Your version

5.16.0

20 Nov 2025Where it was published

5.18.2 is the newest release of 5.x.

In short

1 breaking6 new2 fixed

  • Breaking

    BREAKING CHANGE to the experimental Fonts API only

Security

14 advisories affect 5.16.0; 7.4.7 fixes them

9 more

Release note

Minor Changes

  • Adds experimental SVGO optimization support for SVG assets

    Astro now supports automatic SVG optimization using SVGO during build time. This experimental feature helps reduce SVG file sizes while maintaining visual quality, improving your site's performance.

    To enable SVG optimization with default settings, add the following to your astro.config.mjs:

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        svgo: true,
      },
    });

    To customize optimization, pass a SVGO configuration object:

    export default defineConfig({
      experimental: {
        svgo: {
          plugins: [
            'preset-default',
            {
              name: 'removeViewBox',
              active: false,
            },
          ],
        },
      },
    });

    For more information on enabling and using this feature in your project, see the experimental SVG optimization docs.

  • Adds a hint for code agents to use the --yes flag to skip prompts when running astro add

  • Adds the ActionInputSchema utility type to automatically infer the TypeScript type of an action's input based on its Zod schema

    For example, this type can be used to retrieve the input type of a form action:

    import { type ActionInputSchema, defineAction } from 'astro:actions';
    import { z } from 'astro/zod';
    
    const action = defineAction({
      accept: 'form',
      input: z.object({ name: z.string() }),
      handler: ({ name }) => ({ message: `Welcome, ${name}!` }),
    });
    
    type Schema = ActionInputSchema<typeof action>;
    // typeof z.object({ name: z.string() })
    
    type Input = z.input<Schema>;
    // { name: string }
  • Adds new CLI shortcuts available when running astro preview:

    • o + enter: open the site in your browser

    • q + enter: quit the preview

    • h + enter: print all available shortcuts

Patch Changes

  • Removes picocolors as dependency in favor of the fork piccolore.

  • Improves astro info

  • Breaking

    BREAKING CHANGE to the experimental Fonts API only

    Updates the default subsets to ["latin"]

    Subsets have been a common source of confusion: they caused a lot of files to be downloaded by default. You now have to manually pick extra subsets.

    Review your Astro config and update subsets if you need, for example if you need greek characters:

    import { defineConfig, fontProviders } from "astro/config"
    
    export default defineConfig({
        experimental: {
            fonts: [{
                name: "Roboto",
                cssVariable: "--font-roboto",
                provider: fontProviders.google(),
    +            subsets: ["latin", "greek"]
            }]
        }
    })

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.