Skip to content

Commit

Permalink
fix: tailwind content sources with template source as function
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Feb 19, 2022
1 parent da52970 commit 5829021
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/generators/tailwindcss.js
Expand Up @@ -60,6 +60,19 @@ module.exports = {
const templateSources = templateObjects.map(template => {
const source = get(template, 'source')

if (typeof source === 'function') {
const sources = source(maizzleConfig)

if (Array.isArray(sources)) {
sources.map(s => config.content.files.push(s))
} else if (typeof sources === 'string') {
config.content.files.push(sources)
}

// Must return a valid `content` entry
return {raw: '', extension: 'html'}
}

return `${source}/**/*.*`
})

Expand Down

0 comments on commit 5829021

Please sign in to comment.