-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
101 lines (85 loc) · 2.17 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
'use strict'
module.exports = function (grunt) {
// Load all grunt tasks matching the `grunt-*` pattern.
require('load-grunt-tasks')(grunt)
// Time how long tasks take.
require('time-grunt')(grunt)
var pkg = grunt.file.readJSON('package.json')
var config = {
sassdoc: {
// Bare minimum.
bare: {
src: 'test/fixture/**/*.scss'
},
// Glob patterns Array.
srcs: {
src: ['test/fixture/scss-one/**/*.scss', 'test/fixture/scss-two/**/*.scss']
},
// With config passed in as an external file.
config: {
src: ['test/fixture/**/*.scss'],
options: {
config: 'test/config.json'
}
},
// With config passed in as object.
opts: {
src: 'test/fixture/**/*.scss',
options: {
// cli opts.
verbose: true,
theme: 'default',
// SassDoc opts.
package: pkg,
autofill: ['requires', 'throws'],
groups: {
'undefined': 'Ungrouped',
'foo': 'Foo group',
'bar': 'Bar group'
},
// theme opts.
display: {
access: ['public', 'private'],
alias: true,
watermark: true
},
basePath: 'https://github.com/SassDoc/grunt-sassdoc/tree/master/test/fixture'
}
}
},
tape: {
files: ['test/*.test.js']
},
clean: {
test: ['sassdoc']
},
standard: {
target: ['tasks/*.js', 'test/*.js', 'Gruntfile.js']
}
}
grunt.initConfig(config)
grunt.loadTasks('tasks')
grunt.registerTask('test', [
'standard',
'sassdoc:bare',
'tape',
'clean:test',
'sassdoc:srcs',
'tape',
'clean:test',
'sassdoc:config',
'tape',
'clean:test',
'sassdoc:opts',
'tape',
'clean:test'
])
// // Examples using start and done events.
// grunt.event.on('sassdoc.start', function (target, src, dest) {
// grunt.log.writeln(target + ': compiling ' + src + ' to ' + dest)
// })
//
// grunt.event.on('sassdoc.done', function (target, src, dest) {
// grunt.log.writeln(target + ': ' + src + ' compiled to ' + dest)
// })
}