This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (51 loc) · 1.73 KB
/
gulpfile.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
'use strict';
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var _ = require('lodash');
var tasks = require('bd-gulp-tasks');
var karma = require('karma-as-promised');
var sequence = require('run-sequence');
gutil.log('Environment:', gutil.colors.cyan(tasks.env.env));
tasks.use('lint', ['./src/**/*.js', './test/**/*.js', './gulpfile.js']);
tasks.use('clean', 'build');
tasks.use('templates', './src/**/views/*.html', 'build/views');
tasks.use('styles', './styles/index.scss', './build/styles');
tasks.use('bundle', './src/index.js', './build/scripts', {});
tasks.use('index', './src/index.html', './build');
tasks.use('server', void 0, void 0, {
localEnv: {
'firebase__endpoint': 'https://valet-io-events-dev.firebaseio.com',
'valet__api': 'http://valet-io-pledge-dev.herokuapp.com',
'sentry__dsn': 'https://[email protected]/38955'
}
});
tasks.use('watch', {
'./src/**/views/*.html': 'templates',
'./src/index.html': 'index',
'./styles/**/*.scss': 'styles',
'./src/index.js': 'bundle',
'./images/**/*': 'images'
}, void 0,
{
build: './build',
prerequisites: ['templates', 'styles', 'index', 'images']
});
gulp.task('unit', function () {
var base = require('./karma');
return karma.server.start(_.extend({}, base, gutil.env.sauce && require('./karma.js')))
.then(function () {
process.exit(0);
})
.catch(function () {
process.exit(1);
});
});
gulp.task('images', function () {
return gulp.src('images/**/*')
.pipe(gulp.dest('build/images'));
});
gulp.task('build', ['clean'], function (done) {
sequence(['bundle', 'templates', 'styles', 'images'], 'index', done);
});
gulp.task('serve', ['watch', 'server']);