How to include a static JSON file for compilation with Jade and Grunt
问题 how do I compile Jade templates to static HTML via Grunt where my data is already held in a JSON file? Say I have this Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-jade'); grunt.initConfig( { jade: { html: { src: './*.jade', dest: './index2.html', options: { client: false, pretty: true } } } }); grunt.registerTask('default', 'jade'); }; This JSON file (./data.json) { "foo": {value: 1}, "bar": {value: 2}, "baz": {value: 3} } And this Jade (./index.jade) ul