-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
72 lines (55 loc) · 1.9 KB
/
index.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
/* global process */
module.exports = function(grunt) {
'use strict';
var matchdep = require('matchdep'),
_ = require('lodash'),
path = require('path'),
base = process.cwd(),
//
// Where can I find asimov-build?
//
asimovBuildPath = path.resolve(
grunt.file.readJSON('./package.json').name === 'asimov-build' ?
'.' :
'node_modules/asimov-build'
),
//
// Load asimov-build's grunt config from whereever it's installed
//
buildConfig = require(asimovBuildPath + '/grunt/config/asimov')(grunt)
;
//
// Set asimov-build's grunt config under the `asimov` namespace
//
grunt.config.set('asimov', buildConfig.asimov);
return {
bootstrap: function() {
//
// Load asimov-build's grunt tasks from whereever it's installed
//
grunt.loadTasks(asimovBuildPath + '/grunt');
//
// Load asimov-build's npm tasks
//
matchdep.filter('grunt-!(cli)', asimovBuildPath + '/package.json')
.forEach(function (task) {
// need to temporarily change base for grunt.loadNpmTasks to work
grunt.file.setBase(asimovBuildPath);
grunt.loadNpmTasks(task);
grunt.file.setBase(base);
});
},
getSassLoadPaths: function() {
return require('./lib/sass-load-paths')(grunt);
},
getRequireJSComponents: function(defaults) {
return require('./lib/requirejs-components')(grunt, defaults || {});
},
getRequireJSPaths: function() {
return require('./lib/requirejs-paths')(grunt);
},
getRequireJSShims: function() {
return require('./lib/requirejs-shims')(grunt);
}
};
};