/
Gruntfile.js
135 lines (118 loc) · 3.27 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
123
124
125
126
127
128
129
130
131
132
133
134
135
/******************************************************************
* Sass-Boost
* Grunt Setup
* @uthor [@esr360](http://twitter.com/esr360)
******************************************************************/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/**
* Clean
* @see https://github.com/gruntjs/grunt-contrib-clean
*/
clean: {
default: {
src: 'dist'
}
},
/**
* Concat
* @see https://github.com/gruntjs/grunt-contrib-concat
*/
concat: {
default: {
src: ['src/functions/*.scss'],
dest: 'dist/_sass-boost.scss'
}
},
/**
* Scss Lint
* @see https://github.com/ahmednuaman/grunt-scss-lint
*/
scsslint: {
options: {
config: '.scss-lint.yml',
colorizeOutput: false
},
default: [
'src/**/*.scss'
]
},
/**
* Mocha Cli
* @note used for Scss unit testing
* @see https://github.com/Rowno/grunt-mocha-cli
*/
mochacli: {
scss: ['unit-testing/tests.js']
},
/**
* SassDoc
* @see https://github.com/SassDoc/grunt-sassdoc
*/
sassdoc: {
default: {
src: ['src/**/*.scss'],
options: {
dest: 'docs'
}
}
},
/**
* Watch
* @see https://github.com/gruntjs/grunt-contrib-watch
*/
watch: {
options: {
spawn: false,
},
default: {
files: ['src/**/*.scss'],
tasks: [
'scsslint',
'mochacli:scss',
'sassdoc',
'notify:css'
]
}
},
/**
* Notify
* @see https://github.com/dylang/grunt-notify
*/
notify: {
default: {
options: {
title: 'Success',
message: 'There were no errors running the compile tasks'
}
}
}
});
/**************************************************************
* Load NPM Tasks
*************************************************************/
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-cli');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-sassdoc');
grunt.loadNpmTasks('grunt-scss-lint');
/**************************************************************
* Tasks
*************************************************************/
// Default Grunt task
grunt.registerTask('default', [
'compile',
'watch'
]);
// Compile the app
grunt.registerTask('compile', [
'scsslint',
'mochacli',
'clean',
'concat',
'sassdoc'
]);
};