0

I’m working on a project in Laravel 12 using Vite, and I have a directory like resources/css/partials/ that contains several separate CSS files. Right now, Vite only compiles the files that I explicitly import. I would like Vite to automatically include and compile all CSS files inside that folder without manually adding each one.

5
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Nov 16 at 6:19
  • Solution 1: Use a glob import in your main CSS file (recommended) Commented Nov 16 at 7:21
  • Solution 2: Use Vite glob import inside your JS entry Commented Nov 16 at 7:21
  • Solution 3: Use @import with subfolders (recursive) Commented Nov 16 at 7:22
  • The glob import order is not guaranteed. If you need specific ordering (e.g., variables → utilities → components), consider prefixing filenames: Commented Nov 16 at 7:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.