forked from ruhley/DataTables-CustomSearch
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
91 lines (75 loc) · 2.06 KB
/
Gruntfile.js
File metadata and controls
91 lines (75 loc) · 2.06 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
* # Grunt
* A task manager for auto compiling and validating code
*
* ## Set up
* Make sure the you have nodejs running on your machine
* Install Grunt with npm `npm install -g grunt-cli`
* Install Grunt packages `npm install`
*
* ## Config
* The configuration settings are found in `package.json`.
*
* ## Running
* You can type `grunt <command>` to run any of rules in the `initConfig` function
* e.g. `grunt compass` to compile the scss files to css
*
* You can also run a sub-task by adding `:<subtask>`
* e.g. `grunt uglify:js` to compile to javaScript header file
*
* ## Helper Commands
* There are a number of helper command at the end of the file
* - default (`grunt`) will watch the folder and compile when files are saved
*/
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function(grunt) {
'use strict';
// require it at the top and pass in the grunt instance
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '<%= pkg.name %> by <%= pkg.author %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)',
bannerJS:
'/*\n' +
' * <%= meta.banner %>\n' +
' */'
},
uglify: {
js: {
options: {
banner: '<%= meta.bannerJS %>\n',
sourceMap: true,
mangle: false
},
files: {
'jquery.datatables.customsearch.min.js': ['jquery.datatables.customsearch.js']
}
}
},
watch: {
options: {
spawn: false,
livereload: true
},
js: {
files: ['*.js'],
tasks: [
'uglify:js'
]
},
}
});
// load all plugins from the "package.json"-file
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['watch']);
grunt.registerTask(
'build',
'Build this ... yeaahhh!',
[ 'uglify:js']
);
};