forked from Jakobovski/angular-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
100 lines (89 loc) · 2.58 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
/*jslint node: true */
'use strict';
var pkg = require('./package.json');
module.exports = function(grunt) {
// Grunt Config
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 9001,
base: '.'
}
}
},
concat: {
"options": {
"separator": ";"
},
"build": {
"src": "src/*.js",
"dest": "dist/angular-validator.js"
}
},
ngAnnotate: {
main: {
src: 'dist/angular-validator.js',
dest: 'dist/angular-validator.js'
},
},
uglify: {
dist: {
src: "dist/angular-validator.js",
dest: "dist/angular-validator.min.js"
}
},
jshint: {
files: ['Gruntfile.js', 'src/*.js'],
options: {
jshintrc: true
}
},
watch: {
files: ['src/*.js', 'demo/*.*'],
tasks: ['build'],
options: {
livereload: true
}
},
karma: {
options: {
configFile: 'karma.conf.js'
},
build: {
singleRun: true,
autoWatch: true
},
debug: {
singleRun: false,
autoWatch: true,
browsers: ['Chrome']
},
travis: {
singleRun: true,
autoWatch: false,
browsers: ['Firefox']
},
dev: {
autoWatch: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-ng-annotate');
// Load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks('grunt-contrib-concat');
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
// Register Task
grunt.registerTask('serve', ['connect', 'watch']);
grunt.registerTask('build', ['concat', 'ngAnnotate', 'uglify', 'karma:build']);
grunt.registerTask('test', ['karma:build', ]);
grunt.registerTask('test-debug', ['karma:debug']);
grunt.registerTask('travis', ['karma:travis']);
};