Skip to content

app.config.ts configuration from external file #5549

@lmrtn

Description

@lmrtn

Environment

macos
node 24
pnpm 10.17.1

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

v4.1.0

Reproduction

Import ui from node_module library to define app.config.ts

Description

Hello, I'm trying to configure nuxt/ui in 2 different projects.

Both of them install a private library which contains :

  • various custom components
  • the root.css file containing all the nuxt/ui variables a
  • a JSON file with the ui object used to configure nuxt/ui.

Vue 3 + Vite ✅

I can import the JSON file in my vite.config.ts and tailwind will scan correctly the file and create the styles associated with my configuration (stuff like disabled:bg-[var(--ui-bg-muted)]).

Nuxt ❌

I added the following in the app.config.ts file:

import uiConfig from '@private/my_package/nuxtui.config.json'
export default defineAppConfig(uiConfig)

The classes are applied to the components but the style is not created by tailwind so for any class where I use this format XXX-[var(--XXX)] the style does not work.
I've tried adding tailwind's @source in my main.css file to force scan of my config (that I exported as json and ts) but same result.

Am I missing something ?

Thanks for your help

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions