咕噜玉 – 如何编译单一的玉文件,而不是一切

我有我的jade.js文件中的以下内容

'use strict'; var config = require('../config'); module.exports = { dist: { options: { pretty: true, debug: false, timestamp: '<%= new Date().getTime() %>' }, files: [{ expand: true, cwd: 'html_templates/views/', src: '**/*.jade', dest: 'html_templates/html/', ext: '.html' }] } }; 

这是伟大的工作! 唯一的问题是,我正在一个非常大的应用程序,我的玉文件超过10MB。 当我修改一个玉文件的视图,并运行“咕噜玉”。 它重新编译我所有的HTML(大约需要5分钟)。 如何告诉grunt只编译相关的jade文件(只有一个html文件)

例如:我正在处理:

 html_templates/views/module/landingpage2.jade 

我只想编译:

 html_templates/html/module/landingpage1.html 

请帮忙

使用grunt-newerhttps://www.npmjs.org/package/grunt-newer

只要安装它,并运行你的任务为“新:玉”,几乎就是这一切。

它也适用于手表等。