-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
96 lines (82 loc) · 2.19 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
(function () {
'use strict';
module.exports = function(grunt) {
// Shorthand for loading all grunt tasks.
require('load-grunt-tasks')(grunt);
// See http://bit.ly/drupal-sass-breakpoints
var eyeglass = require('eyeglass');
grunt.initConfig({
// Watch for changes to SCSS files to pre- and post- process CSS.
watch: {
sass: {
files: ['scss/{,**/}*.scss', 'Gruntfile.js', '*.yml', '.scss-lint.yml'],
tasks: [/*'scsslint:dist', */'sass:dist', 'autoprefixer:dist']
},
js: {
files: ['js/{,**/}*.js', '!js/{,**/}*.min.js'],
tasks: ['jshint']
},
},
// We write our styles in SCSS and let grunt compile down to CSS.
sass: {
options: eyeglass({
outputStyle: 'expanded'
}),
dist: {
expand: true,
flatten: true,
src: 'scss/{,**/}*.scss',
dest: 'css/',
ext: '.css'
},
},
// Lint SCSS files.
scsslint: {
options: {
config: '.scss-lint.yml',
colorizeOutput: true
},
dist: ['scss/{,**/}*.scss'],
},
// Autoprefixer post-processes the generated CSS files.
autoprefixer: {
options: {
browsers: ['last 2 versions', 'ie >= 8', '> 1% in US']
},
dist: {
expand: true,
flatten: true,
src: 'css/**/*.css',
dest: 'css/'
},
},
// Lint all javascript files.
jshint: {
options: {
jshintrc: '.jshintrc'
},
dist: ['js/{,**/}*.js']
},
// Minify all SVG files in "images" folder.
svgmin: {
options: {
plugins: [
{
removeViewBox: false
}, {
removeUselessStrokeAndFill: false
}
]
},
dist: {
expand: true,
flatten: true,
src: 'images/**/*.svg',
dest: 'images/'
},
},
});
// Running `grunt` in the cli will automatically execute the following tasks:
grunt.registerTask('default', ['sass:dist', 'autoprefixer:dist', 'watch']);
};
}());