From 5829021256d9b38ef160320b25a158f7dbed6a02 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Sat, 19 Feb 2022 15:40:56 +0200 Subject: [PATCH] fix: tailwind content sources with template source as function --- src/generators/tailwindcss.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/generators/tailwindcss.js b/src/generators/tailwindcss.js index 23b101f6..7738ee89 100644 --- a/src/generators/tailwindcss.js +++ b/src/generators/tailwindcss.js @@ -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}/**/*.*` })