-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
71 lines (69 loc) · 1.69 KB
/
Copy pathGruntfile.js
File metadata and controls
71 lines (69 loc) · 1.69 KB
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
/**
* A module that defines the configuration and registers both
* defaults and globals for the project's Grunt tasks
* @module tabsaver/grunt
* @author Kostyanntyn Didenko <kdidenko@ito-global.com>
* @since 1.2.0
*
* @todo: 1. define module:tabsaver.grunt.uglify tasks using `grunt-contrib-uglify` plug-in
* @todo: 2. define module:tabsaver.grunt.watch tasks using `grunt-contrib-watch` plug-in
* @todo: 3. define module:tabsaver.grunt.cssmin tasks using `grunt-contrib-cssmin` plug-in
* */
/**
* @function
* Creates the initial Grunt configuration, loads the rest of Grunt tasks
* and registeres Grunt's global tasks
*
* @param {IGrunt} grunt - instance itself
* @returns void
*/
module.exports = function (grunt) {
'use strict';
// init Grunt project configuration
grunt.initConfig({
/**
* @readonly
* read and store the project's metadata and settings
*/
package: grunt.file.readJSON('package.json'),
/**
* @readonly
* @enum enumerates main paths for current project
*/
paths: {
src: 'src/',
build: 'build/',
tests: 'test/',
grunt: {
file: 'Gruntfile.js',
tasks: 'grunt/'
}
},
/**
* @readonly
* @enum enumerates main matching globs for project files
*/
globs: {
js: {
flat: '*.js',
deep: '**/*.js'
}
}
});
/**
* @external
* load and marge external Grunt tasks into current configuration
*/
grunt.loadTasks(grunt.config('paths.grunt.tasks'));
/**
* @global
* register Grunt project global tasks
* @requires module:tabsaver.grunt.jshint
*/
grunt.registerTask('build', ['jshint-all']);
/**
* @default
* register Grunt project default task
*/
grunt.registerTask('default', ['build']);
};