Grunt找不到源文件
配置文件如下:
module.exports = function(grunt)
{
grunt.initConfig(
{
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
compress: true
},
files: {
"WebstormProjects/JSTimer/css/result.css": "WebstormProjects/JSTimer/LESS/style.less"
}
},
production: {
options: {
compress: true
},
files: {
"WebstormProjects/JSTimer/css/result.css": "WebstormProjects/JSTimer/LESS/style.less"
}
}
},
watch:
{
css:
{
files: ['WebstormProjects/JSTimer/LESS/style.less'],
tasks: ['less']
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['less']);};
文件目录结构如下
JSTimer
css
result.css
LESS
style.less
Gruntfile.js
package.json
如上,刚开始学着用grunt编译less文件,根目录运行grunt说找不到文件,
VFdeMacBook-Pro:JSTimer VF$ grunt
Running "less:development" (less) task
>> Destination WebstormProjects/JSTimer/css/result.css not written because no source files were found.
Running "less:production" (less) task
>> Destination WebstormProjects/JSTimer/css/result.css not written because no source files were found.
麻烦大家帮忙看看,谢谢了
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论