I have the following in my jade.js file
'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'
}]
}
};
It is working great ! The only problem is that, i am working on a very large application and my jade files are over 10mb. When i modify the view of one jade file and run 'grunt jade'. It recompiles all my html (takes about 5 minutes). How to i tell grunt to only compile the relevant jade file(only one html file)
Example: I am working on:
html_templates/views/module/landingpage2.jade
I want to compile only:
html_templates/html/module/landingpage1.html
Please help
Use grunt-newer
. https://www.npmjs.org/package/grunt-newer
Just install it and run your task as "newer:jade" and pretty much that's all.
It also works with watch etc.