forked from akempes/angular-rateit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
111 lines (96 loc) · 2.32 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
/*global module, require*/
module.exports = function (grunt) {
'use strict';
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Define the configuration for all the tasks
grunt.initConfig({
// Project settings
config: {
src: 'src',
dist: 'dist',
tmp: '.tmp'
},
// Empties folders to start fresh
clean: {
dist: {
files: [{
dot: true,
src: [
'.tmp',
'<%= config.dist %>/**/*'
]
}]
}
},
// A multi-task to validate your JavaScript files with JSLint.
jslint: {
scripts: {
src: ['<%= config.src %>/ng-rateit.js'],
directives: {
predef: ['angular','document','window','console'],
white: true,
regexp: true,
newcap: true,
todo: true
}
}
},
removelogging: {
dist: {
src: "<%= config.src %>/ng-rateit.js",
dest: "<%= config.dist %>/ng-rateit.js"
}
},
// ng-annotate tries to make the code safe for minification automatically
// by using the Angular long form for dependency injection.
ngAnnotate: {
dist: {
files: [{
expand: true,
src: '<%= config.dist %>/ng-rateit.js',
dest: ''
}]
}
},
// Minify files with UglifyJS.
uglify: {
build: {
files: {
'<%= config.dist %>/ng-rateit.min.js': ['<%= config.dist %>/ng-rateit.js']
}
}
},
// Copies remaining files to places other tasks can use
copy: {
dist: {
files: [{
src: '<%= config.src %>/star.gif',
dest: '<%= config.dist %>/star.gif'
}]
}
},
// The following *-min tasks will produce minified files in the dist folder
// By default, your `index.html`'s <!-- Usemin block --> will take care of
// minification. These next options are pre-configured if you do not wish
// to use the Usemin blocks.
cssmin: {
dist: {
files: {
'<%= config.dist %>/ng-rateit.css': [
'<%= config.src %>/ng-rateit.css'
]
}
}
}
});
grunt.registerTask('build', [
'clean',
'jslint',
'removelogging',
'ngAnnotate',
'uglify',
'copy',
'cssmin'
]);
};