Answer the question
In order to leave comments, you need to log in
How to correctly distribute front-end files (css) in laravel?
The bottom line is this: there are style files (bootstrap, "self-made", etc.) that need to be attached to the project. These files often contain a route to images in the . But I need to arrange images/videos etc.
Is it possible to change the path to the files in the css templates themselves, or is it better (more ethical, chtoli) to transfer the content to where the css template asks?
I often see this in bootstrap files.url="../images/имя_картинки.расширение"
Answer the question
In order to leave comments, you need to log in
In my opinion, as you put it, it would be more ethical to "move the content to where the css template asks." Fortunately, all modern frameworks "require" the same folder structure. Agree, it’s inconvenient to climb through files every time and replace paths to resources there.
This is called "code minimization". The source code is "fed" to an algorithm that removes all spaces, tabs, line breaks, comments, and so on. This procedure is performed in order to reduce the file size. Minimized files weigh an order of magnitude less than non-minimized ones, which helps to reduce site loading time. By the way, I highly recommend using the GulpJS project builder. After installing the necessary dependencies and setting up the gulp file, it will minify everything and assemble it into one compact js or css file. Thus, all styles will only be in 1 small file, and all js code will be in another (Instead of a dozen different files with bootstrap - styles, your native styles, etc.). This approach reduces the number of requests to the server and has a positive effect on performance.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question