-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
122 lines (118 loc) · 3.74 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
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
clean: ['dist/*'],
compass: {
dist: {
options: {
sassDir: 'app/sass',
cssDir: 'dist/assets/css',
outputStyle: 'expanded'
}
}
},
connect: {
options: {
hostname: 'localhost',
open: false
},
dist: {
options: {
base: 'dist',
port: 9000,
livereload: true
}
},
test: {
options: {
base: 'tests',
port: 9001
}
}
},
copy: {
dist: {
files: [
{
expand: true,
cwd: 'app',
src: ['{,*/}*.html'],
dest: 'dist'
},
{
expand: true,
cwd: 'app/img/',
src: ['{,*/}*.*'],
dest: 'dist/assets/img'
},
{
expand: true,
cwd: 'app/bower_components/sass-bootstrap/dist/fonts',
src: ['{,*/}*.*'],
dest: 'dist/assets/fonts'
},
{
expand: true,
cwd: 'app/bower_components/jquery',
src: ['jquery.min.js'],
dest: 'dist/assets/js/vendor'
},
{
expand: true,
cwd: 'app/bower_components/lodash/dist',
src: ['lodash.min.js'],
dest: 'dist/assets/js/vendor'
},
{
expand: true,
cwd: 'app/js',
src: ['{,*/}*.js'],
dest: 'dist/assets/js'
}
]
}
},
modernizr: {
devFile: 'app/bower_components/modernizr',
outputFile: 'dist/assets/js/vendor/modernizr.min.js',
files: [
'dist/assets/css/{,*/}*.css',
'dist/assets/js/{,*/}*.js',
'dist/assets/js/vendor/{,*/}*.js'
],
extra: {
shiv: false,
printshiv: true,
load: false,
mq: false,
cssclasses: true
},
uglify: false
},
watch: {
compass: {
files: ['app/sass/{,*/}*.{scss,sass}'],
tasks: ['compass:dist'],
options: {
spawn: false,
livereload: true
}
},
copy: {
files: ['app/{,*/}*.html', 'app/img/{,*/}*.*', 'app/bower_components/sass-bootstrap/dist/fonts/{,*/}*.*', 'app/js/{,*/}*.js'],
tasks: ['copy:dist'],
options: {
spawn: false,
livereload: true
}
},
gruntfile: {
files: ['Gruntfile.js']
}
}
});
grunt.registerTask('build', ['clean', 'compass:dist', 'copy:dist', 'modernizr']);
grunt.registerTask('serve', ['compass:dist', 'copy:dist', 'modernizr', 'connect', 'watch']);
grunt.registerTask('default', ['clean', 'compass:dist', 'copy:dist']);
};