-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
104 lines (99 loc) · 2.26 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
module.exports = function (grunt) {
'use strict';
var port = 8981;
grunt.initConfig({
browserify: {
dist: {
files: {
'build/hoist.js': ['src/hoist.js']
}
},
debug: {
files: {
'build/hoist.js': ['src/hoist.js']
},
options: {
bundleOptions: {
debug: false
}
}
}
},
uglify: {
dist: {
files: {
'build/hoist.min.js': ['build/hoist.js']
}
}
},
mocha_phantomjs: {
all: {
options: {
reporter: grunt.option('reporter') || 'spec',
urls: [
'http://localhost:8000/testrunner.html',
'http://localhost:8000/testrunner-vanilla.html'
],
setting: {
"webSecurityEnabled": false
}
}
}
},
connect: {
server: {
options: {
port: 8000,
base: '.',
}
},
develop: {
options: {
port: 8001,
base: '.'
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['tests/test.node.js']
}
},
jshint: {
options: {
laxcomma: true,
expr: true
},
tests: {
options: {
'-W030': true, // to.be.true syntax
},
src: ['tests/**/*.js']
},
lib: ['Gruntfile.js', 'src/**/*.js']
},
watch: {
js: {
files: ['src/*.js'],
tasks: ['jshint', 'browserify:debug', 'mochaTest']
},
tests: {
files: ['tests/*/*.js'],
tasks: ['jshint', 'mochaTest']
}
},
bower: {
install: {
//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('build',['browserify:dist','uglify:dist']);
grunt.registerTask("test", ['jshint', 'browserify:debug', 'browserify:dist', 'uglify:dist', 'connect:server', 'mocha_phantomjs', 'mochaTest']);
grunt.registerTask("default", ['jshint']);
grunt.registerTask("develop", ['jshint', 'browserify:debug', 'browserify:dist', 'uglify:dist', 'mochaTest', 'connect:develop', 'watch']);
};