-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgruntfile.js
More file actions
98 lines (90 loc) · 2.48 KB
/
gruntfile.js
File metadata and controls
98 lines (90 loc) · 2.48 KB
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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-htmlhint');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-cssc');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.initConfig ({
uglify: {
my_target: {
files: {
'_/js/script.js' : ['_/components/js/*.js'] //compresses and combine multiple js files
} //files
} //my_target
}, //uglify
jshint: {
js_target: {
src: ['_/components/js/*.js']
}, //js_target
options: { force: true }, //report JSHint errors but not fail the task
}, //jshint
compass: {
dev: {
options: {
config: 'config.rb'
} //options
} //dev
}, //compass
cssc: {
build: {
options: {
consolidateViaDeclarations: true,
consolidateViaSelectors: true,
consolidateMediaQueries: true
}
} //build
}, //cssc
autoprefixer: {
build: {
expand: true,
flatten: true,
src: '_/css/style.css',
dest: '_/css'
} //build
}, //autoprefixer
cssmin: {
build: {
src: '_/css/style.css',
dest: '_/css/style.css'
} //build
}, //cssmin
htmlhint: {
build: {
options: {
'tag-pair': true,
// Force tags to have a closing pair
'tagname-lowercase': true,
// Force tags to be lowercase
'attr-lowercase': true,
// Force attribute names to be lowercase e.g. <div id="header"> is invalid
'attr-value-double-quotes': true,
// Force attributes to have double quotes rather than single
'spec-char-escape': true,
// Force special characters to be escaped
'id-unique': true
// Prevent using the same ID multiple times in a document
}, //options
src: ['*.html']
} //build
}, //htmlhint
watch: {
options: { livereload: true }, // reloads browser on save
scripts: {
files: ['_/components/js/*.js'],
tasks: ['jshint', 'uglify']
}, //scripts
html: {
files: ['*.html'],
tasks: ['htmlhint:build']
}, //html
sass: {
files: ['_/components/sass/*.scss'],
tasks: ['compass:dev', 'autoprefixer:build', 'cssc:build', 'cssmin:build']
} //sass
} //watch
}) //initConfig
grunt.registerTask('default', 'watch');
} //exports