Upgrading @nuxtjs/tailwindcss 5 to 6
Breaking5.3.5 → 6.14.0Breaking2New20Changed32Fixed56Other78
BreakingUpgrade verdict
2 breaking changes.
In plain terms
- Tailwind will no longer scan files inside modules when looking for class names, so some styles that came from module code may disappear.
- The built-in viewer now works with the newer h3 server library, which may require updating your h3 version.
Must act 2 items need code or config changes
Adds c12 ^3.0.2, h3 ^1.15.1, klona ^2.0.6, ohash ^2.0.11, pathe ^2.0.3, pkg-types ^2.1.0, unctx ^2.4.1.
Drops @nuxt/postcss8, chalk, clear-module, postcss-custom-properties.
Installs 251 packages in all (was 297).
What you must change
Breaking2
Excludes modules from Tailwind content scanning, which can change generated CSS for projects relying on module paths.
Updates the viewer dev middleware to be compatible with h3@0.8.
h3@0.8API changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- removed:
interface NuxtConfig - removed:
interface NuxtOptions - removed:
property NuxtConfig['tailwindcss']?: Partial<ModuleOptions> - removed:
property NuxtOptions['tailwindcss']?: ModuleOptions - added:
property NuxtHooks.'tailwindcss:internal:regenerateTemplates': (data?: { configTemplateUpdated?: boolean }) => void | Promise<void>
- added:
interface NuxtHooks extends ModuleHooks - added:
property NuxtHooks.'tailwindcss:internal:regenerateTemplates': (data?: { configTemplateUpdated?: boolean }) => void | Promise<void>
- added:
const ctx: unctx.UseContext<boolean> - added:
const default: typeof _defineConfig - added:
const defineConfig: typeof _defineConfig
- added:
const default: (base: Input, ...defaults: Input[]) => Partial<TWConfig>
- removed:
interface ModuleHooks - removed:
interface ModuleOptions - removed:
property ModuleHooks.'tailwindcss:config': (tailwindConfig: any) => void - removed:
property ModuleOptions.config: Config - removed:
property ModuleOptions.configPath: Arrayable<string> - removed:
property ModuleOptions.cssPath: string - removed:
property ModuleOptions.disableHmrHotfix: boolean - removed:
property ModuleOptions.exposeConfig: boolean - removed:
property ModuleOptions.injectPosition: InjectPosition - removed:
property ModuleOptions.viewer: boolean - changed:
const default: _nuxt_schema.NuxtModule<ModuleOptions> → const default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false> - added:
declare module '@nuxt/schema' - added:
declare module 'nuxt/schema' - added:
export { ModuleHooks } - added:
export { ModuleOptions }
- added:
const autocompleteUtil: <T extends TemplateStringsArray | string>(tailwindClasses: T) => T
- added:
interface M - added:
interface a - added:
property M.'tailwindcss:config': (tailwindConfig: Partial<TWConfig>) => void - added:
property M.'tailwindcss:loadConfig': (tailwindConfig: Partial<TWConfig> | undefined, configPath: string, index: number, configPaths: string[]) => void - added:
property M.'tailwindcss:resolvedConfig': (tailwindConfig: ReturnType<typeof tailwindcss_resolveConfig>, oldTailwindConfig: TWConfig | undefined) => void - added:
property a.config: Arrayable<InlineTWConfig | string> - added:
property a.configPath: Arrayable<string> - added:
property a.cssPath: string | false | [string, { injectPosition: InjectPosition }] - added:
property a.disableHMR?: boolean - added:
property a.editorSupport: BoolObj<EditorSupportConfig> - added:
property a.experimental?: Partial<ExperimentalOptions> - added:
property a.exposeConfig: BoolObj<ExposeConfig> - added:
property a.quiet: boolean - added:
property a.viewer: BoolObj<ViewerConfig> - added:
type T = tailwindcss.Config
- added:
export { ModuleHooks } from './module' - added:
export { ModuleOptions } from './module'