-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
41 lines (32 loc) · 951 Bytes
/
gulpfile.js
File metadata and controls
41 lines (32 loc) · 951 Bytes
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
/**
* Created by Samuel on 12/29/2016.
*/
const gulp = require('gulp');
const path = require('path');
const paths = require('./tasks/paths');
require('./tasks/clean');
require('./tasks/copy');
require('./tasks/build');
// default
gulp.task('default', ['clean', 'copy', 'build'], function () { // create small express server
var express = require('express');
var app = express();
app.use(express.static('dist'));
var port = process.env.PORT || 3000;
app.listen(port, function () {
console.log("Listening on " + port);
});
});
var browserSync = require('browser-sync').create();
gulp.task('dev', ['clean', 'copy', 'build'], function () { // watch
browserSync.init({
open: false,
server: {
baseDir: './dist'
}
});
gulp.watch(['src/**/*.*', 'static/**/*.*'], ['clean', 'copy', 'build', 'reload']);
});
gulp.task('reload', function() {
browserSync.reload();
});