This repository has been archived by the owner on Aug 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
115 lines (103 loc) · 2.35 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
module.exports = function(grunt) {
// Load all Grunt plugins tasks
require('load-grunt-tasks')(grunt);
// Grunt Configuration
grunt.initConfig({
// grunt-contrib-clean
clean: {
dist: ['dist'],
icons: ['dist/assets/svg']
},
copy: {
dist: {
expand: true,
cwd: 'src',
src: ['fonts/**/*', 'svg/image-*.svg'],
dest: 'dist/assets/'
}
},
// grunt-contrib-sass
sass: {
options: {
style: 'expanded',
precision: 10
},
dist: {
options: {
sourcemap: 'none'
},
files: [
{
expand: true,
cwd: 'src/',
src: ['**/*.scss'],
dest: 'dist/assets/css/',
ext: '.css'
}
]
}
},
// grunt-autoprefixer
autoprefixer: {
options: {
browsers: ['last 2 versions', 'last 3 iOS versions', 'Explorer >= 9'],
cascade: false
},
dist: { src: 'dist/assets/css/primer.css' }
},
// grunt-contrib-cssmin
cssmin: {
options: {
report: 'gzip'
},
dist: {
files: [
{ 'dist/assets/css/primer.min.css': 'dist/assets/css/primer.css' }
]
}
},
// grunt-contrib-watch
watch: {
sass: {
files: ['**/*.scss'],
tasks: ['clean', 'sass:dist', 'autoprefixer:dist']
}
},
// grunt-svgstore
svgstore: {
options: {
cleanup: ['fill', 'fill-rule'],
svg: {
style: 'display: none;',
xmlns: 'http://www.w3.org/2000/svg',
'xmlns:sketch': 'http://www.bohemiancoding.com/sketch/ns',
'xmlns:xlink': 'http://www.w3.org/1999/xlink'
}
},
default: {
files: {
'dist/assets/svg/primer-iconset.svg': ['src/svg/icon-*.svg']
}
}
},
// grunt-contrib-imagemin
imagemin: {
dist: {
options: {
optimizationLevel: 3
},
files: [
{
expand: true,
cwd: '',
src: ['src/svg/*.svg'],
dest: ''
}
]
}
}
});
// Registered Grunt tasks
grunt.registerTask('default', ['clean', 'sass:dist', 'autoprefixer:dist', 'cssmin:dist', 'icons']);
grunt.registerTask('icons', ['clean:icons', 'imagemin', 'copy', 'svgstore']);
};