#5255·unocss

warnings about `transformIndexHtml` not being supported

Author: beeequeueCreated Jul 24, 2026Updated Jul 24, 2026

UnoCSS version

66.7.5

Describe the bug

vite logs warnings about transformIndexHtml in all unocss modes

12:24:49 [vite] vite.config.ts changed, restarting server...
The following plugins may not work correctly because they use the `transformIndexHtml` hook which is not supported:

  - unocss:transformers:pre
  - unocss:global
  - unocss:transformers:default
  - unocss:transformers:post

i think may be causing transformerDirectives to not work on html files, but i've always had trouble with it so i'm not sure

Reproduction

i use these (simplified) vite and unocss configs:

typescript
// unocss.config.ts

import extractorSvelte from "@unocss/extractor-svelte"
import presetIcons from "@unocss/preset-icons"
import presetWebFonts from "@unocss/preset-web-fonts"
import presetWind3 from "@unocss/preset-wind3"
import transformerCompileClass from "@unocss/transformer-compile-class"
import transformerDirectives from "@unocss/transformer-directives"
import type { VitePluginConfig } from "@unocss/vite"

export default {
  presets: [
    presetWind3(),
    presetIcons(),
    presetWebFonts(),
  ],
  extractors: [extractorSvelte()],
  transformers: [
    transformerDirectives(),
    transformerCompileClass(),
  ],
} satisfies VitePluginConfig
typescript
// vite.config.ts

import adapter from "@sveltejs/adapter-node"
import { sveltekit } from "@sveltejs/kit/vite"
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
import unocss from "@unocss/vite"
import { defineConfig } from "vite"

export default defineConfig({
  plugins: [
    unocss(),
    sveltekit({
      experimental: { remoteFunctions: true },
      compilerOptions: { experimental: { async: true }, modernAst: true },
      adapter: adapter({ precompress: false }),
      preprocess: vitePreprocess(),
    }),
  ],
})

System Info

No response

Validations