-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
102 lines (97 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
module.exports = function (grunt) {
// Load all tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssc: {
build: {
options: {
consolidateViaDeclarations: true
},
files: {
'build/css/main.css': 'build/css/main.css'
}
}
},
cssmin: {
build: {
src: 'build/css/main.css',
dest: 'build/css/main.css'
}
},
copy: {
indexHtml: {
src: 'index.html',
dest: 'build/index.html',
},
},
htmlhint: {
build: {
options: {
'attr-lowercase': true,
'attr-value-double-quotes': true,
'attr-value-not-empty': true,
'doctype-first': true,
'head-script-disabled': true,
'id-class-value': true,
'id-unique': true,
'img-alt-require': true,
'spec-char-escape': true,
'src-not-empty': true,
'style-disabled': true,
'tag-pair': true,
'tag-self-close': true,
'tagname-lowercase': true
},
src: ['index.html']
}
},
jasmine: {
pivotal: {
src: 'assets/js/**/*.js',
options: {
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js'
}
}
},
uglify: {
build: {
files: {
'build/js/main.min.js': ['assets/js/jquery-2.0.3.min.js', 'assets/js/main.js']
}
}
},
sass: {
build: {
files: {
'build/css/main.css': 'assets/scss/main.scss'
}
}
},
watch: {
css: {
files: ['assets/scss/**/*.scss'],
tasks: ['buildcss']
},
html: {
files: ['index.html'],
tasks: ['buildhtml']
},
js: {
files: ['assets/js/main.js'],
tasks: ['buildjs']
},
specs: {
files: ['spec/*Spec.js'],
tasks: ['jasmine']
}
}
});
grunt.registerTask('default', []);
grunt.registerTask('build', ['sass', 'cssc', 'cssmin', 'htmlhint', 'copy:indexHtml', 'uglify', 'jasmine'])
grunt.registerTask('buildcss', ['sass', 'cssc', 'cssmin']);
grunt.registerTask('buildhtml', ['htmlhint', 'copy:indexHtml']);
grunt.registerTask('buildjs', ['uglify', 'jasmine']);
};