How to build assets in a modular structure
I need some advice on best practices for assets management on a large Laravel 10 project using Vite. In the resources directory I have structured my assets logically by "module" i.e.
- resources
- assets
- foo-module
- css
- a.css
- b.css
- js
- x.js
- y.js
- css
- bar-module
- css
- a.css
- b.css
- js
- x.js
- y.js
- css
- foo-module
- views
- assets
I want Vite to build and write these assets to the "public/assets" directory using the exact same directory structure as above.
I've tried a few methods and came close, the .js files are written to "public/build/assets/foo/* etc., but not the .css files, they are always written to "public/build/" only.
What is the most-used, best approach for managing/organising large assets in Laravel?
How do you change the default output directory from "public/build" to "public/assets"?
If my approach is correct, please assist me in solving this problem with Vite.
Thanks.
Please or to participate in this conversation.