-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.config.js
69 lines (62 loc) · 1.6 KB
/
gulpfile.config.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
/*
* GULP TASKS CONFIGURATION
* This file contains the variables used in gulp tasks.
*/
'use strict';
var path = require('path');
var gutil = require('gulp-util');
var fs = require('fs');
var bower = JSON.parse(fs.readFileSync('.bowerrc', 'utf8'));
/**
* The main paths of your project, handle these with care.
*/
exports.paths = {
src: 'sources',
dist: 'dist',
tmp: '.tmp',
e2e: 'e2e',
main: 'main',
bower: bower.directory
};
/**
* Backend proxy configuration.
* With the given example, HTTP request to like $http.get('/api/stuff') will be automatically proxified
* to the specified server.
*
* For more details and option, see https://github.com/chimurai/http-proxy-middleware/
*/
exports.backendProxy = [
{
context: '/api/jokes',
options: {
pathRewrite: { '^/api': '' },
target: 'http://api.icndb.com',
changeOrigin: true
}
}, {
context: '/api',
options: {
target: 'http://apitraining.azurewebsites.net',
changeOrigin: true
}
}
];
/**
* Wiredep is the lib which inject bower dependencies in your project.
* Mainly used to inject script tags in the index.html but also used to inject css preprocessor
* deps and js files in karma.
*/
exports.wiredep = {
exclude: [],
directory: path.join(exports.paths.src, bower.directory),
bowerJson: require('./' + path.join(exports.paths.src, 'bower.json'))
};
/**
* Common implementation for an error handler of a gulp plugin.
*/
exports.errorHandler = function (title) {
return function (err) {
gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
this.emit('end');
};
};