-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
84 lines (77 loc) · 1.73 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
module.exports = function (grunt) {
'use strict';
// Force use of Unix newlines
grunt.util.linefeed = '\n';
RegExp.quote = function (string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
};
var mq4HoverShim = require('mq4-hover-shim');
var autoprefixer = require('autoprefixer')([
"Chrome >= 45",
"Firefox ESR",
"Edge >= 12",
"Explorer >= 10",
"iOS >= 9",
"Safari >= 9",
"Android >= 4.4",
"Opera >= 30"
]);
// Project configuration.
grunt.initConfig({
sass: {
options: {
includePaths: ['node_modules/bootstrap/scss'],
precision: 6,
sourceComments: false,
sourceMap: true,
outputStyle: 'expanded'
},
dist: {
files: {
'css/app.css': 'scss/app.scss'
}
}
},
postcss: {
core: {
options: {
map: true,
processors: [
mq4HoverShim.postprocessorFor({ hoverSelectorPrefix: '.bs-true-hover ' }),
autoprefixer
]
},
src: 'css/*.css'
}
},
watch: {
sass: {
files: 'scss/**/*.scss',
tasks: ['compile-sass'],
options: {
livereload: true
}
},
html: {
files: '*.html',
options: {
livereload: true
}
}
},
connect: {
server: {
options: {
port: 8080,
livereload: true
}
}
}
});
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt, {});
require('time-grunt')(grunt);
grunt.registerTask('compile-sass', ['sass', 'postcss']);
// Default task.
grunt.registerTask('default', ['sass', 'postcss', 'connect', 'watch']);
};