This repository has been archived by the owner on May 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGruntfile.js
64 lines (56 loc) · 2.07 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = function(grunt){
grunt.initConfig({
jshint: {
dist: {
options: {
// enable additional checks:
curly: true,
newcap: true,
// disable default checks:
boss: true, // allows us to do for loops like: for (var i=0, item; item=items[i]; i++) {
expr: true, // allows us to do fn calls in one-line expressions like: x === 1 && show(x);
},
src: [
'template_helpers.js'
]
}
},
jasmine: {
src: [
'template_helpers.js',
],
options: {
vendor: [
'bower_components/handlebars/handlebars.min.js',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/duckduckgo-utils/util.js',
'build/templates-answerbar.js'
],
specs: [
'test/*.js'
]
}
},
handlebars: {
compile: {
src: './bower_components/duckduckgo-answerbar-templates/**/*.handlebars',
dest: "./build/templates-answerbar.js",
options: {
namespace: "DDG.templates",
processName: function(filepath) {
var parts = filepath.split('/');
return parts[parts.length - 1].replace('.handlebars','');
},
processContent: function(content, filepath) {
content = content.replace(/\n\s+|\n/g,'');
return content;
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.registerTask("test", "Lint and test", ["jshint", "handlebars", "jasmine"]);
};