Closed kevadamson closed 4 years ago
That depends. If the "layout.less" files are the only less files that you want to compile, then this can be achieved by using the main
setting in the settings.json file:
{
"less.compile": {
"main": ["${workspaceRoot}/folder1/layout.less", "${workspaceRoot}/folder2/layout.less"]
}
}
If you have other less files that you want to auto-compile, then the situation is somewhat more complicated, unfortunately.
When a main
file is specified at the settings level, then it applies to all less files within your project.
Thanks for the speedy response. I could, in theory, end up with a lot of main declarations (the project I'm working on could have a lot of "skins"), so I was hoping there might be a declaration like:
"main": ["${workspaceRoot}/*/*/layout.less"]
Where * is any named folder. So I don't have to repeat each time. Make sense?
Yeah, it makes sense. Unfortunately not supported, and I'm unlikely to implement because using glob patterns will incur a search cost every time a less file is saved (... or alternatively, easyless would need to keep track of all files named layout.less
that match the pattern).
You might be interested in a more advanced solution such as gulp-less or webpack.
Is this possible? For example I have many instances of "layout.less" in various folders. I would like them to compile each time another less file is saved, without having to manually add each instance to "main:". Does that make sense?