Dotlesscss @import 语句:找不到文件。使用梳子
在 asp.net mvc 3 项目中,我使用 Combres 来组合和缩小我的 CSS 文件。我正在使用 dotlesscss 过滤器来获取精美的 css 附加内容,例如变量。
但是,当我尝试使用 dotlesscss @import 语句 (请参阅页面底部的导入), css 生成失败并出现以下错误:
Could not find a part of the path 'C:\Program Files (x86)\IIS Express\colors.less'.
很明显,无点编译器正在错误的目录中查找,但是:如何修复此问题?
[编辑]:根据要求:我尝试了以下语法:
@import "Colors.less"
@import "~/Content/Colors.less"
In an asp.net mvc 3 project, i'm using Combres to combine and minify my CSS files. I'm using the dotlesscss filter for fancy css extras such as variables.
However, when i try to use the dotlesscss @import statement (see importing at bottom of page), css generation failes with the following error:
Could not find a part of the path 'C:\Program Files (x86)\IIS Express\colors.less'.
It's clear that the dotless compiler is looking in the wrong directory, however: how to fix this?
[edit]: as requested: i tried the following synaxes:
@import "Colors.less"
@import "~/Content/Colors.less"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
DotlessCssCombineFilter
而不是DotlessCssFilter
。然后从 *.less 文件中删除@import
语句,并在resourceSet
中按正确的顺序导入 *.less 文件。Use the
DotlessCssCombineFilter
instead of theDotlessCssFilter
. Then remove the@import
statements from your *.less files, and instead import the *.less files in the right order inside theresourceSet
.接受的答案是一种变通方法,而不是解决方案。
这是问题的修复,这是给 Combres 团队的建议。
The accepted answer is a work around, not a fix.
Here is the fix to the issue and here is the suggestion to the Combres team.