-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathGruntfile.js
131 lines (127 loc) · 3.03 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
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
less: {
all: {
options: {
strictMath: true,
outputSourceFiles: true
},
files: {
'public/assets/css/bootstrap.css': 'src/less/bootstrap.less',
'public/assets/css/app.css': 'src/less/app.less'
}
}
},
autoprefixer: {
options: {
browsers: [
'Android 2.3',
'Android >= 4',
'Chrome >= 20',
'Firefox >= 24', // Firefox 24 is the latest ESR
'Explorer >= 8',
'iOS >= 6',
'Opera >= 12',
'Safari >= 6'
]
},
all: {
src: [
'public/assets/css/bootstrap.css',
'public/assets/css/app.css'
]
}
},
csscomb: {
options: {
config: 'bower_components/bootstrap/less/.csscomb.json'
},
all: {
expand: true,
cwd: 'public/assets/css',
src: [
'bootstrap.css',
'app.css'
],
dest: 'public/assets/css'
}
},
cssmin: {
options: {
compatibility: 'ie8',
keepSpecialComments: 0,
advanced: false
},
all: {
files: {
'public/assets/css/bootstrap.css': 'public/assets/css/bootstrap.css',
'public/assets/css/app.css': 'public/assets/css/app.css'
}
}
},
concat: {
common: {
files: {
'public/assets/js/jquery.plugins.js': [
'bower_components/bootstrap/js/collapse.js',
'bower_components/bootstrap/js/dropdown.js',
'bower_components/bootstrap/js/modal.js',
'bower_components/bootstrap/js/tab.js'
]
}
}
},
uglify: {
all: {
files: {
'public/assets/js/jquery.plugins.js': 'public/assets/js/jquery.plugins.js'
}
}
},
filerev: {
options: {
algorithm: 'sha256',
length: 8
},
js: {
src: [
'public/assets/js/jquery.plugins.js'
]
},
css: {
src: [
'public/assets/css/app.css',
'public/assets/css/bootstrap.css'
]
}
},
filerev_replace: {
options: {
assets_root: 'public'
},
views: {
src: 'public/**/*.html'
}
},
watch: {
"css": {
files: [
'src/less/**/*.less'
],
tasks: ['less']
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-csscomb');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-filerev');
grunt.loadNpmTasks('grunt-filerev-replace');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('devel', ['less', 'autoprefixer', 'csscomb', 'concat']);
grunt.registerTask('default', ['devel', 'cssmin', 'uglify', 'filerev', 'filerev_replace']);
};