grunt 使用 grunt-contrib-livereload 时提示 Warning: Arguments to path.resolve must be strings Use --force to continue.

命令与返回

P:\ms>grunt live
Running "livereload-start" task
... Starting Livereload server on 35729 ...

Running "connect:livereload" (connect) task
Warning: Arguments to path.resolve must be strings Use --force to continue.

Aborted due to warnings.

Gruntfile.js 部分

livereload: {
        port: 35729 // Default livereload listening port.
},
connect: {
    livereload: {
        options: {
            port: 9001,
            hostname: 'localhost',
            base: '.',
            middleware: function(connect, options) {
                return [lrSnippet, folderMount(connect, options.base)]
            }
        }
    }
},
regarde: {
    jade: {
        files: '*.jade',
        tasks: ['jade']
    },
    html: {
        files: ['index.html', 'css/my.css', 'Gruntfile.js'],
        tasks: ['jsbeautifier', 'livereload']
    },
    coffee: {
        files: 'js/my.coffee',
        tasks: 'coffee'
    }
},

grunt.registerTask('live', ['livereload-start', 'connect', 'regarde']);
查看回复