-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathGruntfile.js
136 lines (133 loc) · 3.86 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['src/core/**/*.js', 'test/**/*.js']
},
// BOWER
bower: {
install: {
options: {
targetDir: './bower_components'
}
}
},
// KARMA TASK CONFIG
karma: {
options: {
basePath: './',
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'dist/angular-awesome-slider.min.js',
/*'src/core/ng-slider.js',
'src/core/config/constants.js',
'src/core/model/draggable.factory.js',
'src/core/model/pointer.factory.js',
'src/core/model/slider.factory.js',
'src/core/utils/utils.factory.js',
'src/core/template/slider.tmpl.js',*/
'dist/css/angular-awesome-slider.min.css',
'test/**/*Spec.js'
],
autoWatch: true,
singleRun: true
},
unit: {
options: {
browsers: ['PhantomJS']
}
},
captureTimeout: 20000,
continuous: {
options: {
browsers: ['PhantomJS']
}
}
},
// LESS CSS TASKS
less: {
development: {
options: {
paths: ['src/css/less/']
},
files: {
'src/css/angular-awesome-slider.css': 'src/css/less/main.less'
}
}
},
// UGLIFY TASK
uglify: {
task1: {
options: {
preserveComments: 'some',
report: 'min',
banner: '/** \n* @license <%= pkg.name %> - v<%= pkg.version %>\n' +
'* (c) 2013 Julien VALERY https://github.com/darul75/angular-awesome-slider\n' +
'* License: MIT \n**/\n'
},
files: {
'dist/angular-awesome-slider.min.js': ['dist/angular-awesome-slider.js']
/*'dist/ng-slider.tmpl.min.js': ['src/ng-slider.tmpl.js']*/
}
}
},
// CONCAT FILES
concat: {
options: {
separator: ';'
},
dist: {
src: [
'src/core/index.js',
'src/core/config/constants.js',
'src/core/utils/utils.factory.js',
'src/core/model/draggable.factory.js',
'src/core/model/pointer.factory.js',
'src/core/model/slider.factory.js',
'src/core/template/slider.tmpl.js'
],
dest: 'dist/angular-awesome-slider.js'
}
},
// MINIFY CSS
cssmin: {
options: {
keepSpecialComments: false,
banner: '/** \n* @license <%= pkg.name %> - v<%= pkg.version %>\n' +
'* (c) 2013 Julien VALERY https://github.com/darul75/angular-awesome-slider\n' +
'* License: MIT \n**/\n'
},
compress: {
files: {
'dist/css/angular-awesome-slider.min.css': ['src/css/angular-awesome-slider.css']
}
}
},
// COPY CONTENT
copy: {
main: {
files: [
// slider
{expand: true, flatten: true, src: ['src/img/*'], dest: 'dist/img/'},
]
}
},
});
// LOAD PLUGINS
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-karma');
// TASK REGISTER
//grunt.registerTask('default', ['jshint', 'cssmin', 'uglify:task1', 'karma']);
grunt.registerTask('default', ['bower', 'copy', 'concat', 'less', 'cssmin', 'jshint', 'uglify:task1']);
grunt.registerTask('test-continuous', ['jshint', 'bower', 'karma:unit']);
};