From e4b5da266ea3409de75a17caa07060f421f1387a Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Tue, 11 Oct 2022 18:31:58 +0300 Subject: [PATCH] fix: normalize content source paths + type check --- src/generators/tailwindcss.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/generators/tailwindcss.js b/src/generators/tailwindcss.js index f47ab45a..c236b95a 100644 --- a/src/generators/tailwindcss.js +++ b/src/generators/tailwindcss.js @@ -31,12 +31,15 @@ module.exports = { } // Merge user's Tailwind config on top of a 'base' config + const layoutsRoot = get(maizzleConfig, 'build.layouts.root') + const componentsRoot = get(maizzleConfig, 'build.components.root') + const config = merge({ important: true, content: { files: [ - `${get(maizzleConfig, 'build.components.root', './src/components')}/**/*.html`, - `${get(maizzleConfig, 'build.layouts.root', './src/layouts')}/**/*.html`, + typeof layoutsRoot === 'string' ? path.normalize(`${layoutsRoot}/**/*.html`) : './src/layouts/**/*.html', + typeof componentsRoot === 'string' ? path.normalize(`${componentsRoot}/**/*.html`) : './src/components/**/*.html', {raw: html, extension: 'html'} ] }