Closed t4nt3bl4ck closed 4 months ago
Thanks for the effort, but I'm sorry, I don't think I can accept this pull request. The behaviour requested is too specific to your particular folder structure, and would break existing behaviour for other users.
Inside LessCompiler.ts:
Added a function, getSubFolders, to get the sub folders of a specified path. This is used inside the function chooseOutputFilename, so if inside the settings.json is specified a folder path as a different output, the .css files will not be created all right away, but following the folder structure the .less files are in.
This change, though, only works if the "root" of the less files is called "less". Hence for example, given the next structure:
If we save for example the home.less file, and hypothesizing that settings.json => "out": "style/css/", instead of creating the home.css inside "style/css/home.css", it is created as follows: "style/css/pages/home.css".
This upgrade would simplify our life since we would no more need to write the first comment in each .less file (as i had to do previously, as long this was already possible but i didn't find the solution).
Another add: If the "out" is not set inside settings.json, the css files are compiled in their specific "css" folder inside the same basename as the less file