-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntFile.js
90 lines (83 loc) · 1.64 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
78
79
80
81
82
83
84
85
86
87
88
89
90
module.exports = function(grunt) {
"use strict";
require('matchdep')
.filterDev('grunt-*')
.forEach(grunt.loadNpmTasks);
grunt.initConfig({
jshint : {
main : {
src : ['src/**/*.js'],
options : {
jshintrc : '.jshintrc'
}
}
},
jasmine: {
all: {
src: ['src/**/*.js'],
options: {
vendor : [
'vendor/d3.js',
'vendor/d3.chart.js',
'vendor/jquery-1.10.1.min.js'
],
specs: "spec/*Spec.js",
helpers: "spec/helpers/*.js"
}
}
},
copy: {
dist : {
src : 'src/example.js',
dest : 'dist/example.js'
}
},
uglify: {
dist: {
src: 'dist/example.js',
dest : 'dist/example.min.js',
options: {
sourceMap : 'dist/example.map',
sourceMappingURL : 'example.map',
sourceMapPrefix : 1
}
}
},
connect: {
test: {
options: {
port: 9090
}
}
},
watch: {
test: {
files: ['src/**/*.js', 'spec/**/*.js'],
tasks: ['jasmine:all:build', 'jshint'],
options: {
rewatch: true
}
}
},
open: {
testRunner: {
url: 'http://127.0.0.1:9090/_SpecRunner.html'
}
}
});
grunt.registerTask('test-interactive', [
'jasmine:all:build',
'connect:test',
'open:testRunner',
'watch:test'
]);
grunt.registerTask('test', [
'jshint',
'jasmine'
]);
grunt.registerTask('build', [
'copy',
'uglify'
]);
grunt.registerTask('default', ['test', 'build']);
}