-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
81 lines (78 loc) · 1.85 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
'use strict';
module.exports = function (grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
deployableFiles: [
'*.{html,txt,pdf,png}',
'browserconfig.xml',
'css/*',
'img/**/*',
'js/**/*',
'.htaccess'
],
htmlhint: {
build: {
options: {
'tag-pair': true,
'tagname-lowercase': true,
'attr-lowercase': true,
'attr-value-double-quotes': true,
'doctype-first': true,
'spec-char-escape': true,
'id-unique': true,
'style-disabled': true,
'attr-unsafe-chars': true,
'space-tab-mixed-disabled': true
},
src: ['*.html']
}
},
sass: {
dist: {
files: {
'css/sudweb.css': 'sass/sudweb.scss'
},
options: {
sourceMap: true
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'css',
src: ['*.css', '!*.min.css'],
dest: 'css',
ext: '.min.css'
}]
}
},
'gh-pages': {
'production': {
src: '<%= deployableFiles %>',
options: {
repo: 'git@github.com:sudweb/2015.git'
}
},
'dev': {
src: '<%= deployableFiles %>'
}
},
watch: {
html: {
files: '<%= htmlhint.build.src %>',
tasks: ['htmlhint']
},
css: {
files: ['sass/**/*.scss'],
tasks: ['sass:dist', 'cssmin']
}
}
});
grunt.registerTask('default', ['htmlhint', 'sass', 'cssmin', 'watch']);
grunt.registerTask('deploy', ['deploy-prod']);
grunt.registerTask('deploy-dev', ['sass', 'gh-pages:dev']);
grunt.registerTask('deploy-prod', ['sass', 'cssmin', 'gh-pages:production']);
};