forked from jdewit/bootstrap-timepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
113 lines (110 loc) · 2.87 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
105
106
107
108
109
110
111
112
113
module.exports = function(grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
project: 'bootstrap-timepicker',
version: '0.2.3'
},
jasmine: {
build: {
src : ['spec/js/libs/jquery/jquery.min.js', 'spec/js/libs/bootstrap/js/bootstrap.min.js', 'spec/js/libs/autotype/index.js', 'js/bootstrap-timepicker.js'],
options: {
specs : 'spec/js/*Spec.js',
helpers : 'spec/js/helpers/*.js',
timeout : 100
}
}
},
jshint: {
options: {
browser: true,
camelcase: true,
curly: true,
eqeqeq: true,
eqnull: true,
immed: true,
indent: 2,
latedef: true,
newcap: true,
noarg: true,
quotmark: true,
sub: true,
strict: true,
trailing: true,
undef: true,
unused: true,
white: false,
globals: {
jQuery: true,
$: true,
expect: true,
it: true,
beforeEach: true,
afterEach: true,
describe: true,
loadFixtures: true,
console: true,
module: true
}
},
files: ['js/bootstrap-timepicker.js', 'Gruntfile.js', 'package.json', 'spec/js/*Spec.js']
},
less: {
dev: {
options: {
paths: ['css']
},
files: {
'css/bootstrap-timepicker.css': ['less/*.less']
}
},
prod: {
options: {
paths: ['css'],
yuicompress: true
},
files: {
'css/bootstrap-timepicker.min.css': ['less/*.less']
}
}
},
uglify: {
options: {
banner: '/*! <%= meta.project %> v<%= meta.version %> \n' +
'* http://jdewit.github.com/bootstrap-timepicker \n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> Joris de Wit \n' +
'* MIT License \n' +
'*/'
},
build: {
src: ['<banner:meta.banner>','js/<%= pkg.name %>.js'],
dest: 'js/<%= pkg.name %>.min.js'
}
},
watch: {
js: {
files: ['js/bootstrap-timepicker.js', 'spec/js/*Spec.js'],
tasks: ['jshint', 'jasmine'],
options: {
livereload: true
}
},
less: {
files: ['less/timepicker.less'],
tasks: ['less:dev'],
options: {
livereload: true
}
}
}
});
grunt.registerTask('default', ['jshint', 'jasmine', 'less:dev']);
grunt.registerTask('test', ['jasmine', 'jshint']);
grunt.registerTask('compile', ['jshint', 'jasmine', 'uglify', 'less:prod']);
};