dotless:如何使用 dotless.Compiler.exe 处理 LESS 文件列表

发布于 2024-11-24 22:44:29 字数 246 浏览 5 评论 0原文

我想知道如何使用 exe 二进制文件处理 LESS 文件列表,例如:

./dotless.Compiler.exe -m *.less

现在我只能处理单个文件,但不能处理通配符。

我之所以问这个问题是因为我想在MSBuild中创建一个目标,它是为了处理一个项目集合(这是一个文件列表)。我找不到在 MSBuild 中循环任务的方法。如果有人知道如何为每个文件循环一个任务,那也可以解决我的问题。

I wanted to know how to process a list of LESS files using the exe binaries, for example:

./dotless.Compiler.exe -m *.less

Right now I only can do individual files, but can't do wildcard.

The reason why I asked about this is that I want to create a target in MSBuild, which is to process an item collection (which is a list of files). I couldn't find a way to loop a task in side MSBuild. If anyone knows how to loop a task for each file, that would solve my problem too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

路弥 2024-12-01 22:44:29

使用 ItemGroup 获取文件列表,如下所示:

<ItemGroup>
    <MyFiles Include="[path to less files]\*" />
</ItemGroup>

使用 %(MyFiles.FullPath) 语法(也称为 任务批处理)

<Target Name="CompileLess">
   <Exec Command="$(dotLessCompiler) -m %(MyFiles.FullPath)" />
</Target>

Use an ItemGroup to get a list of files like this:

<ItemGroup>
    <MyFiles Include="[path to less files]\*" />
</ItemGroup>

Call the compiler once for each file by using %(MyFiles.FullPath) syntax (also known as Task Batching)

<Target Name="CompileLess">
   <Exec Command="$(dotLessCompiler) -m %(MyFiles.FullPath)" />
</Target>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文