forked from EJJ-Brainstorm/Brainstorm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
73 lines (60 loc) · 1.61 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
nodemon = require('gulp-nodemon'),
bs = require('browser-sync'),
reload = bs.reload,
shell = require('gulp-shell'),
usemin = require('gulp-usemin'),
uglify = require('gulp-uglify'),
minifyHtml = require('gulp-minify-html'),
minifyCss = require('gulp-minify-css'),
rev = require('gulp-rev');
var paths = {
scripts: ['client/app/**/*.js'],
html: ['client/app/**/*.html', 'client/index.html'],
styles: ['client/styles/style.css'],
test: ['specs/server/*.js']
};
gulp.task('test-server', shell.task([
'mocha ' + paths.test
]));
gulp.task('test-client', shell.task([
'jest'
]));
gulp.task('test', shell.task([
'npm test'
]));
gulp.task('bower', shell.task([
'bower install'
]));
gulp.task('selenium', shell.task([
'webdriver-manager start'
]));
gulp.task('e2e', shell.task([
'protractor e2e/conf.js'
]));
gulp.task('jsx', shell.task([
'watchify -d client/app/starter.js -o client/app/bundle.js -v'
]));
gulp.task('usemin', ['jsx'], function() {
gulp.src('./client/index.html')
.pipe(usemin({
css: [minifyCss(), 'concat'],
html: [minifyHtml({empty: true})],
js: [uglify(), rev()]
}))
.pipe(gulp.dest('client/'));
});
gulp.task('serve', function () {
nodemon({script: 'index.js', ignore: 'node_modules/**/*.js'});
});
gulp.task('start', ['serve'], function() {
bs({
notify: true,
injectChanges: true,
files: paths.scripts.concat(paths.html, paths.styles),
proxy: 'localhost:8000'
});
});
gulp.task('default', ['start']);