---
title: "Inline Minification · Nuxt SEO Utils · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/seo-utils/guides/minification"
last_updated: "2026-08-16T10:05:36.158Z"
meta:
  description: "Minify inline scripts and styles at build time, with optional minification for dynamic SSR."
  "og:description": "Minify inline scripts and styles at build time, with optional minification for dynamic SSR."
  "og:title": "Inline Minification · Nuxt SEO Utils · Nuxt SEO"
---

Nuxt SEO on GitHub

Switch to SEO UtilsSwitch to Nuxt SEOSwitch to RobotsSwitch to SitemapSwitch to OG ImageSwitch to Schema.orgSwitch to Link CheckerSwitch to Site ConfigSwitch to Skew ProtectionSwitch to AI Ready

**Core Concepts**

# **Inline Minification**

Nuxt SEO Utils automatically minifies inline `**<script>**` and `**<style>**` tags at build time. Runtime minification is opt-in.

## How It Works

The module provides two complementary minification modes that can be toggled independently.

### Build Mode

At build time, the module has access to native tooling for full minification:

- **JavaScript**: Minified with [**~~Rolldown~~**](https://rolldown.rs/) (Vite 8+) or [**~~esbuild~~**](https://esbuild.github.io/) (Vite 7), automatically detected
- **CSS**: Minified with [**~~lightningcss~~**](https://lightningcss.dev/) (full CSS optimization)

This applies to:

- Static scripts and styles defined in `**app.head**` within your `**nuxt.config**`
- All inline scripts and styles in prerendered/generated route HTML

### Runtime Mode

For dynamic SSR where scripts are generated per request (hydration payloads, `**useHead()**` injections), the module registers an [**~~Unhead~~**](https://unhead.unjs.io/) `**ssr:render**` plugin that minifies `**HeadTag**` content before it's serialized to HTML.

This uses lightweight pure JS minifiers with zero native dependencies. It supports serverless, edge, and Docker deployments.

Build mode uses parser-based minifiers and has no runtime cost. Runtime mode adds work to every SSR request. Enable it only after measuring the transfer savings and CPU cost for your application.

## Configuration

Build mode is enabled by default. You can configure both modes in your `**nuxt.config**`:

```ts
export default defineNuxtConfig({
  seo: {
    minify: { build: true, runtime: false },
  },
})
```

## What Gets Minified

| **Content** | **Build Mode** | **Runtime Mode** |
| --- | --- | --- |
| `**app.head**` scripts/styles | Rolldown or esbuild / lightningcss | n/a (static) |
| Prerendered route HTML | Rolldown or esbuild / lightningcss | n/a (static) |
| Hydration payload (`**__NUXT__**`) | n/a (dynamic) | Lightweight JS |
| `**useHead()**` injected scripts | n/a (dynamic) | Lightweight JS |
| `**useHead()**` injected styles | n/a (dynamic) | Lightweight CSS |

## What Gets Skipped

The following are skipped by the JS minifier:

- JSON script types ( `**application/ld+json**`, `**application/json**`) are minified via `**JSON.parse**`/ `**JSON.stringify**` instead of JS minification
- `**importmap**` and `**speculationrules**` script types are left completely untouched
- External scripts (with `**src**` attribute)

**Was this page helpful?**

### **Related **

[**Config**](https://nuxtseo.com/docs/seo-utils/api/config)

[**Best Practice Default Meta**](https://nuxtseo.com/docs/seo-utils/guides/default-meta)

[**Nuxt SEO**](https://nuxtseo.com/docs/nuxt-seo/guides/using-the-modules)

[**CLI** Use the nuxt-seo-utils CLI to generate favicon and icon variants.](https://nuxtseo.com/docs/seo-utils/guides/cli) [**Config** Configuration options for Nuxt SEO Utils module.](https://nuxtseo.com/docs/seo-utils/api/config)