From 6d401016ae6053b5fd7b87aa42bec5df19a237fc Mon Sep 17 00:00:00 2001 From: Dave Gaeddert Date: Mon, 27 Nov 2023 16:39:27 -0600 Subject: [PATCH] Use installed package configs to get tailwind paths --- bolt-tailwind/bolt/tailwind/cli.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bolt-tailwind/bolt/tailwind/cli.py b/bolt-tailwind/bolt/tailwind/cli.py index 175ace939f..fffdd29c80 100644 --- a/bolt-tailwind/bolt/tailwind/cli.py +++ b/bolt-tailwind/bolt/tailwind/cli.py @@ -1,8 +1,8 @@ import os -import sys import click +from bolt.packages import packages from bolt.runtime import APP_PATH from .core import Tailwind @@ -74,14 +74,15 @@ def compile(watch, minify): # These paths should actually work on Windows too # https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows args.append("--content") - content = ",".join( - [ - os.path.relpath(APP_PATH) + "/**/*.{html,js}", - os.path.relpath(APP_PATH) - + "/../bolt/**/*.{html,js}", # TODO use INSTALLED_PACKAGES? - sys.exec_prefix + "/lib/python*/site-packages/bolt*/**/*.{html,js}", - ] - ) + paths = [ + os.path.relpath(APP_PATH) + "/**/*.{html,js}", + ] + + # Add paths from installed packages + for package_config in packages.get_package_configs(): + paths.append(os.path.relpath(package_config.path) + "/**/*.{html,js}") + + content = ",".join(paths) print(f"Content: {content}") args.append(content)