-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (43 loc) · 1.13 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
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var header = require('gulp-header');
var cleanCSS = require('gulp-clean-css');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var filter = require('gulp-filter');
var pkg = require('./package.json');
var webserver = require('gulp-webserver');
// Configure the browserSync task
gulp.task('browserSync', function() {
browserSync.init({
server: {
baseDir: 'app'
},
})
})
gulp.task('copy', function() {
gulp.src([
'data/accidents.json'
])
.pipe(gulp.dest('app/data'))
})
// Dev task with browserSync
gulp.task('dev', ['copy', 'browserSync'], function() {
// Reloads the browser whenever HTML or JS files change
gulp.watch('app/*.html', browserSync.reload);
gulp.watch('app/*.js', browserSync.reload);
//gulp.watch('data/*.json', browserSync.reload);
});
gulp.task('webserver', function() {
gulp.src('app')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('heroku', function() {
return gulp.src('./app/').pipe(webserver({
https: false,
open: false
}));
});