forked from adamalbrecht/ngQuickDate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
96 lines (92 loc) · 2.52 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compile: {
files: {
"dist/ng-quick-date.js": ["src/*.coffee"]
}
}
},
uglify: {
my_target: {
files: {
"dist/ng-quick-date.min.js": "dist/ng-quick-date.js"
}
}
},
less: {
compile: {
files: {
"dist/ng-quick-date.css": ["src/ng-quick-date.less"],
"dist/ng-quick-date-default-theme.css": ["src/ng-quick-date-default-theme.less"],
"dist/ng-quick-date-plus-default-theme.css": ["src/ng-quick-date.less", "src/ng-quick-date-default-theme.less"]
}
}
},
watch: {
scripts: {
files: ['**/*.coffee', '**/*.less'],
tasks: ['coffee', 'uglify', 'less', 'karma:unit'],
options: {
debounceDelay: 250
}
}
},
karma: {
options: {
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/jquery/jquery.js',
'vendor/browserTrigger.js',
'src/*.coffee',
'spec/*.coffee'
],
plugins: [
'karma-spec-reporter',
'karma-failed-reporter',
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-coffee-preprocessor'
],
browsers: ['PhantomJS'],
frameworks: ['jasmine'],
preprocessors: {
'**/*.coffee': ['coffee']
},
coffeePreprocessor: {
options: {
bare: true,
sourceMap: false
},
transformPath: function (path) {
return path.replace(/\.coffee$/, '.js');
}
},
reporters: ['spec', 'failed'],
reportSlowerThan: 500
},
unit: {
singleRun: true,
background: false
},
debug: {
singleRun: false,
background: false,
browsers: ['Chrome']
}
}
});
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('build', ['coffee', 'uglify', 'less']);
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('debug_test', ['karma:debug']);
grunt.registerTask('default', ['build', 'test', 'watch']);
};