-
Notifications
You must be signed in to change notification settings - Fork 11
/
Gruntfile.js
32 lines (29 loc) · 922 Bytes
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var path = require('path')
module.exports = function (grunt) {
grunt.initConfig({
nunjucks: {
options: {
fooName: 'foo',
data: grunt.file.readJSON('tests/data.json'),
preprocessData: function (data) {
data.page = path.basename(this.src[0], '.html')
return data
},
configureEnvironment: function (env) {
var options = this.options()
env.addGlobal(options.fooName, 'bar')
}
},
render: {
files: {
'tests/base/_output.html': ['tests/base/input.html'],
'tests/autoescape/_output.html': ['tests/autoescape/input.html'],
'tests/leaking-vars/_output1.html': ['tests/leaking-vars/input1.html'],
'tests/leaking-vars/_output2.html': ['tests/leaking-vars/input2.html']
}
}
}
})
grunt.loadTasks('tasks/')
grunt.registerTask('test', ['nunjucks'])
}