forked from danielgiovanni/template-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulp.config.js
127 lines (115 loc) · 3.23 KB
/
gulp.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module.exports = function() {
var client = './src/client/';
var clientApp = client + 'app/';
var report = './report/';
var server = './src/server/';
var temp = './.tmp/';
var root = './';
var wiredep = require('wiredep');
var bowerFiles = wiredep({devDependencies: true}).js;
var config = {
alljs: [
'./src/**/*.js',
'./*.js',
'!./src/server/**/*.js'
],
build: './build/',
client: client,
css: temp + 'styles/styles.css',
fonts: './bower_components/materialize/font/**/*.*',
html: clientApp + '**/*.html',
htmlTemplates: clientApp + '**/*.html',
images: client + 'images/**/*.*',
index: client + 'index.html',
js: [
clientApp + '**/*.module.js',
clientApp + '**/*.js',
'!' + clientApp + '**/*.spec.js'
],
less: client + 'styles/*.less',
root: root,
server: server,
temp: temp,
report: report,
/**
* optimized files
*/
optimized: {
app: 'app.js',
lib: 'lib.js'
},
/**
* template cache
*/
templateCache: {
file: 'template.js',
options: {
module: 'app.core',
standAlone: false,
root: 'app/'
}
},
browserReloadDelay: 1000,
bower: {
json: require('./bower.json'),
directory: './bower_components/',
ignorePath: '../../'
},
packages: [
'./package.json',
'./bower.json'
],
testLibraries: [
'node_modules'
],
specs: [clientApp + '**/*.spec.js'],
/**
* Karma and testing Settings
*/
karma: {},
specHelpers: [client + 'test-helpers/*.js'],
/**
* Node Settings
*/
defaultPort: 7203,
nodeServer: './src/server/app.js'
};
config.getWiredepDefaultOptions = function() {
return {
bowerJson: config.bower.json,
exclude: config.bower.exclude,
directory: config.bower.directory,
ignorePath: config.bower.ignorePath
};
};
config.karma = getKarmaOptions();
return config;
/////////////
function getKarmaOptions() {
var options = {
files: [].concat(
config.specHelpers,
bowerFiles,
client + '**/*.module.js',
client + '**/*.js',
temp + config.templateCache.file
),
exclude: [],
html: {
dir: report + 'html',
reportName: 'report-test-summary'
},
coverage: {
dir: report + 'coverage',
reporters: [
{type: 'html', subdir: 'report-html'},
{type: 'lcov', subdir: 'report-lcov'},
{type: 'text-summary'}
]
},
preprocessors: {}
};
options.preprocessors[clientApp + '**/!(*.spec)+(.js)'] = ['coverage'];
return options;
}
};