forked from pkozlowski-opensource/directives-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
80 lines (76 loc) · 1.99 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
var cp = require('child_process');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-karma');
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'package.json', 'src/**/*.js'],
options: {
}
},
html2js: {
options: {
base: '',
module: 'templates',
rename: function (moduleName) {
return '/' + moduleName;
}
},
main: {
src: ['src/**/*.html', '!src/**/index.html', '!src/**/solution/*.html'],
dest: 'tmp/templates.js'
}
},
karma: {
options: {
frameworks: ['jasmine'],
files: [
'lib/jquery-1.10.2.js',
'lib/positioning.js',
'lib/angular.js',
'lib/angular-mocks.js',
'lib/jasmine-matchers.js',
'lib/moment.js',
'src/**/*.js',
'src/**/*.html'
],
exclude: [
'src/**/index.html'
],
browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],
ngHtml2JsPreprocessor: {
prependPrefix: '/',
// setting this option will create only a single module that contains templates
// from all the files, so you can load them all with module('templates')
moduleName: 'templates'
}
},
tdd: {
autoWatch: true
},
ci: {
singleRun: true
}
},
connect: {
server: {
options: {
port: 8000,
base: '.',
keepalive: true,
middleware: function(connect, options){
return [
connect.static(options.base),
connect.directory(options.base)
];
}
}
}
}
});
grunt.registerTask('tdd', ['karma:tdd']);
grunt.registerTask('default', ['jshint', 'html2js', 'karma:ci']);
grunt.registerTask('server', ['connect:server']);
};