繁体   English   中英

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

[英]grunt-contrib-less cannot find source files even though path is correct

我正试图让grunt-contrib-less为我编译一个更少的文件。 我有以下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配置无法正常工作,因为您需要将其放入less的特定target中。 例如

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

并运行

grunt less:yourTarget

您可以根据需要为target命名,但由于less是多任务,因此需要至少有一个目标。

有关使用目标配置任务的文档。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM