-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
42 lines (38 loc) · 1.42 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
"use strict";
var path = require("path"),
shell = require("shelljs");
module.exports = function(grunt) {
var settings = grunt.file.readJSON("settings.json"),
credentials = grunt.file.readJSON(".credentials.json"),
helpers = {
getExec: function(command) {
return ""+((shell.exec(command).output).replace("\n", "")).replace(/\\/g, "/");
},
getProductionFiles: function(filesArr){
var prodJsFiles = [];
for (var i = 0, len = filesArr.length; i < len; i++) {
// replaces only first occurence, perfect for our use-case
prodJsFiles.push( filesArr[i].replace("src/", "build/") );
}
return prodJsFiles;
},
};
require("load-grunt-config")(grunt, {
configPath: path.join(process.cwd(), "grunt/configs"),
data: {
settings: settings,
helpers: helpers,
credentials: credentials
},
jitGrunt: {
// here you can pass options to jit-grunt (or just jitGrunt: true)
staticMappings: {
// here you can specify static mappings, for example:
removelogging: "grunt-remove-logging",
jquery: "grunt-jquery-builder",
lodash: "grunt-lodash",
}
},
});
grunt.task.loadTasks("./grunt/tasks");
};