forked from veo-labs/openveo-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
51 lines (40 loc) · 1.37 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
"use strict";
var path = require("path");
/**
* Loads a bunch of grunt configuration files from the given directory.
*
* Loaded configurations can be referenced using the configuration file name.
* For example, if myConf.js describes a property "test", it will be accessible
* using myConf.test.
*
* @param String path Path of the directory containing configuration files
* @return Object The list of configurations indexed by filename without
* the extension
*/
function loadConfig(path){
var glob = require("glob");
var object = {};
var key;
glob.sync("*", {cwd : path}).forEach(function(option){
key = option.replace(/\.js$/, "");
object[key] = require(path + "/" + option);
});
return object;
}
module.exports = function(grunt){
var config = {
pkg : grunt.file.readJSON("package.json"),
env : process.env
};
grunt.initConfig(config);
grunt.config.merge(loadConfig("./tasks/player"));
// Load grunt plugins
grunt.loadNpmTasks("grunt-contrib-compass");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-karma");
// Register default task to compile sass files on any changes
grunt.registerTask("default", ["compass:dev"]);
// Register dist task to obfuscate and concatenate project sources
grunt.registerTask("dist", ["concat", "uglify", "compass:dist"]);
};