-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
77 lines (75 loc) · 2.74 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
65
66
67
68
69
70
71
72
73
74
75
76
77
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
"Gruntfile.js",
"test/unit/*.js"
],
options: {
jshintrc: ".jshintrc"
}
},
jasmine_node: {
specNameMatcher: "spec",
projectRoot: ".",
requirejs: false,
forceExit: true,
jUnit: {
report: false,
useDotNotation: true,
consolidate: true
},
verbose: true
},
requirejs: {
compile: {
// Available options can be found here
// https://github.com/jrburke/r.js/blob/master/build/example.build.js
options: {
baseUrl: "./",
paths: {
},
optimize: "none",
generateSourceMaps: false,
logLevel: 3,
preserveLicenseComments: false,
onBuildRead: function (moduleName, path, contents) {
var wrappedContents = "define(function (require, exports, module) {\n" + contents + "});\n";
return this.noWrap.indexOf(moduleName) > -1 ? contents : wrappedContents;
},
name: "node_modules/almond/almond",
include: [ "./lib/main",
"lib/dependencies/jquery-2.0.3.min",
"lib/dependencies/underscore-min",
"lib/dependencies/backbone-min",
"lib/dependencies/countdown.min",
],
noWrap: ["node_modules/almond/almond",
"lib/dependencies/jquery-2.0.3.min",
"lib/dependencies/underscore-min",
"lib/dependencies/backbone-min",
"lib/dependencies/countdown.min",
],
insertRequire: ["./lib/main"],
out: "public/js/project-template.js",
wrap: true
}
}
},
watch: {
scripts: {
files: ['lib/**/*.js'],
tasks: ['requirejs'],
}
}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-jasmine-node");
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask("lint", ["jshint"]);
grunt.registerTask("test", ["lint", "jasmine_node"]);
grunt.registerTask("build", ["test", "requirejs"]);
grunt.registerTask("default", ["build"]);
};