-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
83 lines (72 loc) · 1.64 KB
/
index.js
File metadata and controls
83 lines (72 loc) · 1.64 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
var extend = require('extend');
var dots = require('eivindfjeldstad-dot');
var devTasks = require('./tasks/dev');
var webpackTasks = require('./tasks/webpack');
var sharedTasks = require('./tasks/shared');
var serverTasks = require('./tasks/server');
var karmaConf = require('./lib/karma-conf');
exports.init = function(config) {
this.config = extend(true, {
source: {
path: 'app',
assets: 'assets',
features: 'features',
scripts: '.',
styles: '.'
},
target: {
dev: {
path: 'build/dev',
bundleJsLibs: true,
css: {
sourcemaps: true,
minify: false
},
js: {
sourcemaps: true,
minify: false
},
libs: {
bundle: false,
minify: false
}
},
prod: {
path: 'build/prod'
}
},
server: {
dev: {
exec: 'node',
isDev: true,
compress: true
},
prod: {
exec: 'node',
isDev: false,
compress: true
}
}
}, config || {});
if (typeof this.config.source.features === 'string') {
this.config.source.features = [this.config.source.features];
}
return this;
};
exports.start = function(gulp) {
this.gulp = gulp;
sharedTasks.start(gulp, this.config);
webpackTasks.start(gulp, this.config);
devTasks.start(gulp, this.config);
serverTasks.start(gulp, this.config);
};
exports.getConfig = function(path) {
if (path) {
return dots.get(this.config, path);
}
return this.config;
};
exports.getGulp = function() {
return this.gulp;
};
exports.karmaConf = karmaConf;