-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.config.js
98 lines (87 loc) · 2.24 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* 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'));
var HttpsProxyAgent = require('https-proxy-agent');
/**
* The main paths of your project, handle these with care.
*/
exports.paths = {
src: 'sources',
dist: 'www',
tmp: '.tmp',
e2e: 'e2e',
main: 'main',
bower: bower.directory
};
/**
* Sass include paths.
*/
exports.sassIncludePaths = [
bower.directory,
exports.paths.src,
path.join(exports.paths.src, exports.paths.main),
path.join(bower.directory, 'ionic/scss')
];
/**
* Default build environment, see docs/build-environments.md for more info.
*/
exports.defaultBuildEnvironment = 'prod';
/**
* API proxy configuration.
* With the given example, HTTP request to like $http.get('/api/stuff') will be automatically proxified
* to the specified server.
* Multiple endpoints can be configured here.
*
* For more details and option, see https://github.com/chimurai/http-proxy-middleware/
*/
exports.backendProxy = [
{
context: '/api',
options: {
pathRewrite: {'^/api': ''},
target: 'http://api.icndb.com',
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: bower.directory,
bowerJson: require('./bower.json')
};
/**
* Configures a corporate proxy agent for the API proxy.
*/
exports.corporateProxyAgent = function() {
var agent = null;
var proxyServer = process.env.http_proxy || process.env.HTTP_PROXY;
if (proxyServer) {
agent = new HttpsProxyAgent(proxyServer);
gutil.log(gutil.colors.cyan('Using corporate proxy server: ' + proxyServer));
}
return agent;
};
/**
* Common implementation for an error handler of a gulp plugin.
*/
exports.errorHandler = function(title, skipEnd) {
return function(err) {
if (title) {
gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
}
if (!skipEnd) {
this.emit('end');
}
};
};