mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-19 14:31:47 +01:00
fix(module): consider user tailwind configPath for module as string (#2074)
This commit is contained in:
@@ -73,14 +73,24 @@ export default async function installTailwind (
|
||||
`
|
||||
})
|
||||
|
||||
// @ts-expect-error - `@nuxtjs/tailwindcss` not installed yet
|
||||
const { configPath: userTwConfigPath = [], ...twModuleConfig } = nuxt.options.tailwindcss ?? {}
|
||||
|
||||
const twConfigPaths = [
|
||||
configTemplate.dst,
|
||||
join(nuxt.options.rootDir, 'tailwind.config')
|
||||
]
|
||||
|
||||
if (typeof userTwConfigPath === 'string') {
|
||||
twConfigPaths.push(userTwConfigPath)
|
||||
} else {
|
||||
twConfigPaths.push(...userTwConfigPath)
|
||||
}
|
||||
|
||||
// 3. install module
|
||||
await installModule('@nuxtjs/tailwindcss', defu({
|
||||
exposeConfig: true,
|
||||
config: { darkMode: 'class' },
|
||||
configPath: [
|
||||
configTemplate.dst,
|
||||
join(nuxt.options.rootDir, 'tailwind.config')
|
||||
]
|
||||
// @ts-expect-error - `@nuxtjs/tailwindcss` not installed yet
|
||||
}, nuxt.options.tailwindcss))
|
||||
configPath: twConfigPaths
|
||||
}, twModuleConfig))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user