-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
142 lines (132 loc) · 4.11 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
module.exports = function(grunt) {
grunt.initConfig({
lesslint: {
src: [
'assets/less/includes.less'
],
options: {
imports: [
'assets/less/styles.less'
]
}
},
less: {
development: {
options: {
compress: false,
yuicompress: false,
optimization: 2
},
files: {
// target.css file: source.less file
'assets/build/css/styles.css': 'assets/less/includes.less',
}
}
},
autoprefixer: {
options: {
cascade: true
},
development: {
browsers: ['> 2 %', 'last 2 version', 'BB 7', 'BB 10', 'Android 2', 'Android 3', 'Android 4', 'Android 5', 'Firefox ESR'],
expand: true,
flatten: true,
src: 'assets/build/css/*.css',
dest: 'assets/build'
}
},
bowercopy: {
options: {
destPrefix: 'assets/scripts/',
srcPrefix: 'bower_components/'
},
vendor: {
files: {
'vendor/jquery/jquery.min.js' : 'jquery/jquery.min.js',
//'vendor/isotope/isotope.pkgd.min.js' : 'isotope/dist/isotope.pkgd.min.js',
'vendor/jquery-unveil/jquery.unveil.min.js' : 'jquery-unveil/jquery.unveil.min.js'
}
},
},
modernizr: {
dist: {
// [REQUIRED] Path to the build you're using for development.
"devFile" : "assets/scripts/vendor/modernizr/modernizr.dev.js",
// [REQUIRED] Path to save out the built file.
"outputFile" : "assets/build/js/modernizer/modernizr-custom.min.js",
// Based on default settings on http://modernizr.com/download/
"extra" : {
"shiv" : true,
"printshiv" : false,
"load" : true,
"mq" : false,
"cssclasses" : true
},
// Based on default settings on http://modernizr.com/download/
"extensibility" : {
"addtest" : false,
"prefixed" : false,
"teststyles" : false,
"testprops" : false,
"testallprops" : false,
"hasevents" : false,
"prefixes" : false,
"domprefixes" : false
},
// By default, source is uglified before saving
"uglify" : true,
// Define any tests you want to implicitly include.
"tests" : [],
// By default, this task will crawl your project for references to Modernizr tests.
// Set to false to disable.
"parseFiles" : true,
// When parseFiles = true, this task will crawl all *.js, *.css, *.scss files, except files that are in node_modules/.
// You can override this by defining a "files" array below.
// "files" : {
// "src": []
// },
// When parseFiles = true, matchCommunityTests = true will attempt to
// match user-contributed tests.
"matchCommunityTests" : false,
// Have custom Modernizr tests? Add paths to their location here.
"customTests" : []
}
},
watch: {
styles: {
files: ['assets/less/**/*.less', '*.html'],
tasks: ['less', 'autoprefixer', 'modernizr'],
options: {
livereload: true
}
},
scripts: {
files: ['assets/scripts/*.js'],
tasks: [],
options: {
livereload: true
}
},
configFiles: {
files: [ 'gruntfile.js' ],
options: {
reload: true
}
},
dependencies: {
files: ['bower.json'],
tasks: ['bowercopy'],
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks("grunt-modernizr");
grunt.loadNpmTasks('grunt-lesslint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
};