-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
102 lines (99 loc) · 2.34 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
/*!
sonar.css - http://urbanoalvarez.es/sonar.css/
Licensed under the MIT license - http://opensource.org/licenses/MIT
Copyright (c) 2015 Alejandro U. Alvarez
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
tag: {
banner: '/*!\n' +
' * <%= pkg.name %>\n' +
' * <%= pkg.homepage %>\n' +
' * @author <%= pkg.author %>\n' +
' * @version <%= pkg.version %>\n' +
' * Released under the <%= pkg.license %> license.\n' +
' */\n'
},
sass: {
dev: {
options: {
style: 'expanded'
},
files: {
'css/sonar.css': 'sass/sonar.scss'
}
},
dist: {
options: {
style: 'compressed',
sourcemap: 'file'
},
files: {
'css/sonar.min.css': 'sass/sonar.scss'
}
}
},
watch: {
css: {
files: 'sass/**',
tasks: ['sass:dev', 'sass:dist']
}
},
clean: {
build: {
src: ["build"]
}
},
copy: {
main: {
files: [{
expand: true,
src: [
'css/sonar.css',
'index.html'
],
dest: 'build/'
}],
},
},
'gh-pages': {
options: {
base: 'build'
},
src: ['**']
},
replace: {
dist: {
options: {
patterns: [{
match: '{{version}}',
replacement: '<%= pkg.version %>'
}]
},
files: [{
src: ['build/index.html'],
dest: 'build/index.html'
}]
}
},
autoprefixer: {
options: {
browsers: ['last 2 versions', 'Firefox >= 5', 'Opera >= 12', 'Safari >= 4', 'ie 8', 'ie 9'],
},
dist: {
src: ['css/sonar.css', 'css/sonar.min.css']
},
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['sass:dev', 'sass:dist', 'autoprefixer:dist', 'copy', 'replace']);
grunt.registerTask('deploy', ['build', 'gh-pages']);
};