-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
executable file
·79 lines (73 loc) · 2.16 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
'use strict';
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
// initConfig takes an object
// in this object, we list all the tasks that we want to run
pkg: grunt.file.readJSON('package.json'),
bower: {
dev: {
dest: 'client/assets/libs/',
options: {
expand: true
}
}
},
compress: {
main: {
options: {
mode: 'gzip'
},
files: [{
expand: true,
cwd: 'client/assets/json',
src: ['all.json'],
dest: 'client/assets/json',
ext: '.json.gz'
}]
}
},
watch: {
sass: {
files: 'client/assets/css/*.scss',
tasks: ['sass', 'cssmin']
}
},
cssmin: {
target: {
files:[{
expand: true,
cwd: 'client/assets/css/',
src: ['*.css', '!*.min.css'],
dest: 'client/assets/css/',
ext: '.min.css'
}]
}
},
jshint: {
options: {
jshintrc: '.jshintrc',
ignores: 'client/assets'
},
all: [
'Gruntfile.js',
'server.js',
'client/app/**/*.js',
'!**/load-d3.service.js'
]
},
sass: {
dist: {
options: {
style: 'expanded',
sourceMap: false
},
files: {
'client/assets/css/style.css' : 'client/assets/css/*.scss'
}
}
}
});
// here we say what tasks to complete in the second argument, we pass the tasks from our initConfig func above
grunt.registerTask('default', [ 'compress', 'jshint', 'bower', 'sass', 'cssmin', 'watch']);
};