-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
48 lines (39 loc) · 1.13 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
module.exports = function (grunt) {
"use strict";
function loadTasks(path) {
var glob = require('glob'),
object = {},
key;
glob.sync('*', {cwd: path}).forEach(function (option) {
key = option.replace(/\.js$/, '');
object[key] = require(path + option);
});
return object;
}
var config = {
pkg: grunt.file.readJSON('package.json'),
config: (grunt.file.isFile('source/config/paths.json')) ? grunt.file.readJSON('source/config/paths.json') : {}
};
grunt.util._.extend(config, loadTasks('./source/tasks/'));
grunt.initConfig(config);
require('load-grunt-tasks')(grunt);
grunt.registerTask('dev', [
'clean:test',
'jade',
'sass',
'autoprefixer',
'bower_concat',
'concat:js',
'copy:images',
'copy:fonts_test'
]);
grunt.registerTask('build', [
'clean:build',
'htmlmin',
'cssmin',
'uglify',
'imagemin',
'copy:fonts_build'
]);
grunt.registerTask('default', ['dev', 'build', 'browserSync', 'watch']);
};