-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
111 lines (93 loc) · 1.91 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
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// our config
grunt.initConfig({
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
sass_process: {
files: ['test/scss/*.scss','_dev/demo.scss'],
tasks: ['sass']
},
stylus_process: {
files: ['test/stylus/*.styl'],
tasks: ['stylus']
},
less_process: {
files: ['test/less/*.less'],
tasks: ['less']
},
uglify: {
files: ['_dev/demo.js'],
tasks: ['uglify']
},
build: {
files: ['_dev/book*','_dev/index.html','json/*.json','build.*'],
tasks: ['shell:build','less','sass','stylus']
},
tests: {
files: ['test/**/*.{scss|less|styl|js}'],
tasks: ['shell:test']
}
},
// compile sass
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'test/scss/test.css': 'test/scss/test.scss',
'demo.css': '_dev/demo.scss'
}
}
},
// compile stylus
stylus: {
dist: {
files: {
'test/stylus/test.css': 'test/stylus/test.styl'
}
}
},
// compile less
less: {
dist: {
options: {
compress: true,
},
files: {
"test/less/test.css": "test/less/test.less"
}
},
},
// let's squish some js
uglify: {
dist: {
files: {
'demo.js': [
'node_modules/jquery/dist/jquery.js',
'node_modules/fastclick/lib/fastclick.js',
'node_modules/clipboard/dist/clipboard.min.js',
'_dev/demo.js'
]
}
}
},
// generate the sass and html files with node scripts
shell: {
build: {
command: './build.sh'
},
test: {
command: 'mocha'
}
}
});
// test task
grunt.registerTask('test', ['shell:test']);
// build task
grunt.registerTask('build', ['shell:build','stylus','less','shell']);
// register task
grunt.registerTask('default', ['watch']);
};