即使路径正确,javascript – grunt-contrib-less也找不到源文件

栏目: 编程工具 · 发布时间: 7年前

内容简介:代码日志版权声明:翻译自:http://stackoverflow.com/questions/17712214/grunt-contrib-less-cannot-find-source-files-even-though-path-is-correct

我正在努力为我编写一个较少的文件.我有以下gruntfile:

less: {
        files: {
            "httpdocs/static/assets/css/result.css": "httpdocs/static/assets/css/dashboard.less"
        }
    },

路径是绝对正确的,我已经三重检查那些文件存在,但是,当我运行grunt我得到以下消息:

Running "less:files" (less) task
>> Destination not written because no source files were provided.

我从gruntfile中遗漏了什么,使其正确编译少文件?我正在撕裂我的头发,因为我知道这可能是一个很简单的事情,但我无法理解.

您的较少配置不起作用,因为您需要在较少的内容中将其放入特定目标.例如

less: {
   yourTarget : {
        files: {
            "httpdocs/static/assets/css/result.css": "httpdocs/static/assets/css/dashboard.less"
        }
   }
},

并运行使用

grunt less:yourTarget

您可以将目标命名为您想要的内容,但因为较少的是多任务,所以需要至少有一个目标.

Docs on configuring tasks with targets.

代码日志版权声明:

翻译自:http://stackoverflow.com/questions/17712214/grunt-contrib-less-cannot-find-source-files-even-though-path-is-correct


以上所述就是小编给大家介绍的《即使路径正确,javascript – grunt-contrib-less也找不到源文件》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Defensive Design for the Web

Defensive Design for the Web

37signals、Matthew Linderman、Jason Fried / New Riders / 2004-3-2 / GBP 18.99

Let's admit it: Things will go wrong online. No matter how carefully you design a site, no matter how much testing you do, customers still encounter problems. So how do you handle these inevitable bre......一起来看看 《Defensive Design for the Web》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具