Skip to content

Commit

Permalink
fix(tailwind-integration): allow content as object (#2060)
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose committed May 16, 2023
1 parent a1999cd commit 52c7659
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,15 @@ export default defineNuxtModule<ModuleOptions>({
// @nuxtjs/tailwindcss support
// @ts-ignore - Module might not exist
nuxt.hook('tailwindcss:config', (tailwindConfig) => {
const contentPath = resolve(nuxt.options.buildDir, 'content-cache', 'parsed/**/*.md')
tailwindConfig.content = tailwindConfig.content ?? []
tailwindConfig.content.push(resolve(nuxt.options.buildDir, 'content-cache', 'parsed/**/*.md'))

if (Array.isArray(tailwindConfig.content)) {
tailwindConfig.content.push(contentPath)
} else {
tailwindConfig.content.files = tailwindConfig.content.files ?? []
tailwindConfig.content.files.push(contentPath)
}
})

// ignore files
Expand Down

0 comments on commit 52c7659

Please sign in to comment.