-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
127 lines (113 loc) · 3.15 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
module.exports = function (grunt) {
var mozJpeg = require('imagemin-mozjpeg');
grunt.initConfig({
vars: {
favicons: {
src: 'temp/images/favicon.png',
dest: 'build/images/favicons'
}
},
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {}
},
clean: {
generatedResources: 'build'
},
copy: {
html: {
expand: true,
flatten: true,
src: [
'src/index.html'
],
dest: 'dist',
},
images: {
expand: true,
flatten: true,
src: [
'images/**'
],
dest: 'dist/images',
},
fonts: {
expand: true,
flatten: true,
cwd: 'bower_components/font-awesome/fonts',
src: [
'fontawesome-webfont.eot',
'fontawesome-webfont.svg',
'fontawesome-webfont.ttf',
'fontawesome-webfont.woff',
'fontawesome-webfont.woff2'
],
dest: 'dist/fonts',
filter: 'isFile'
}
},
csslint: {
options: {
csslintrc: '.csslintrc'
},
lint: {
options: {
import: 2
},
src: ['dist/css/main.css']
}
},
cssmin: {
options: {
rebase: false
},
minify: {
src: 'dist/css/main.css',
dest: 'dist/css/main.min.css'
}
},
less: {
compile: {
options: {
paths: ['src/less'],
cleancss: false
},
files: {
'dist/css/main.css': 'src/less/main.less'
}
}
},
watch: {
styles: {
files: ['src/less/**/*.less'],
tasks: ['buildStyles']
}
}
});
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-image-resize');
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-svg-to-png');
grunt.registerTask('default', [
'clean:generatedResources',
'bower:install',
'buildStyles',
'copy:html',
'copy:images',
'copy:fonts'
]);
grunt.registerTask('buildStyles', [
'less:compile',
'csslint:lint',
'cssmin:minify'
]);
};