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.

麻烦大家帮忙看看,谢谢了

阅读 3.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题