运行grunt时找不到任务jade

时间:2015-11-04 15:05:29

标签: gruntjs pug

当我使用以下Gruntfile运行grunt时,我收到错误警告:任务" jade"未找到。究竟什么可能出错?

module.exports = function(grunt) {
    grunt.initConfig({

      jade: {
        compile: {
            options: {
                client: false,
                pretty: true
            },
            files: [ {
              cwd: "app/views",
              src: "**/*.jade",
              dest: "build/templates",
              expand: true,
              ext: ".html"
            } ]
        }
    }   
    });

   grunt.registerTask('default','Convert Jade templates into html templates',
                  ['jade','watch']);
  grunt.loadNpmTasks('grunt-contrib-watch');
};

1 个答案:

答案 0 :(得分:2)

你需要加载grunt jade任务。和yo一样正在添加grunt-contrib-watch

grunt.loadNpmTasks('grunt-contrib-jade');

这应该有效。

相关问题