forked from Aberrant-Marble/Aberrant-Marble
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
68 lines (58 loc) · 1.83 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
var gulp = require('gulp');
concat = require('gulp-concat');
nodemon = require('gulp-nodemon');
jshint = require('gulp-jshint');
rename = require('gulp-rename');
uglify = require('gulp-uglify');
browserSync = require('browser-sync');
series = require('stream-series');
inject = require("gulp-inject");
karma = require('karma').server;
watch = require('gulp-watch');
var paths = {
scripts: 'client/*.js',
css: 'client/*.css',
};
var miscCSS = gulp.src(['./bower_components/bootstrap/dist/css/bootstrap.min.css',
'./bower_components/flag-icon-css/css/flag-icon.css',
'./client/styles.css'])
.pipe(concat('bower.css'))
.pipe(gulp.dest('./client/css'));
var appStream = gulp.src(paths.scripts)
.pipe(concat('app.js'))
.pipe(gulp.dest('./client/js'));
// Concatenate vendor scripts
var vendor = gulp.src([
'./bower_components/angular/angular.js',
'./bower_components/ngFx/dist/ngFx.min.js',
'./bower_components/bootstrap/dist/js/bootstrap.min.js'
])
.pipe(concat('vendors.js'))
.pipe(gulp.dest('./client/js'));
gulp.task('scripts', function() {
return gulp.src('./index.html')
.pipe(inject(series(vendor, appStream, miscCSS)))
.pipe(gulp.dest('./'));
});
gulp.task('browser-sync', function() {
browserSync({
proxy: "http://localhost:3000"
});
});
gulp.task('serve', function () {
nodemon({ script: 'server.js', ignore: ['node_modules/**/*.js'] });
});
gulp.task('test', function(done) {
karma.start({
configFile: __dirname + '/my.conf.js',
singleRun: true
}, function() { done();
});
});
gulp.task('default', ['scripts', 'browser-sync', 'test'], function() {
gulp.watch(paths.scripts, ['scripts', browserSync.reload]);
});
/*gulp.task('default', ['scripts'], function () {
return gulp.watch(paths.scripts);
//.pipe(gulp.dest('./build'));
});*/