forked from darul75/angular-awesome-slider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
85 lines (82 loc) · 2.33 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
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['src/ng-slider.js', 'test/**/*.js']
},
// BOWER
bower: {
install: {
options: {
targetDir: './bower_components'
}
}
},
// KARMA TASK CONFIG
karma: {
unit: {
options: {
basePath: './',
frameworks: ['jasmine'],
browsers: ['Chrome'],
autoWatch: true,
singleRun: true,
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'src/ng-slider.js',
'test/**/*Spec.js']
}
}
},
// 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/ng-slider\n' +
'* License: MIT \n**/\n'
},
files: {
'dist/ng-slider.min.js': ['src/ng-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/ng-slider\n' +
'* License: MIT \n**/\n'
},
compress: {
files: {
'dist/css/ng-slider.min.css': ['src/css/ng-slider.css', 'src/css/ng-slider.round.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-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// TASK REGISTER
//grunt.registerTask('default', ['jshint', 'cssmin', 'uglify:task1', 'karma']);
grunt.registerTask('default', ['bower', 'copy', 'cssmin', 'uglify:task1']);
};