/
gulpfile.js
37 lines (34 loc) · 971 Bytes
/
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
// gulp serve
//
// npm install gulp --save-dev
// npm install browser-sync --save-dev
const { gulp, watch, series, parallel, src, dest } = require('gulp');
const browserSync = require('browser-sync').create();
/**
* [serve description]
*/
function serve() {
// Serve files from the root of this project
// https://www.browsersync.io/docs/options
browserSync.init({
server: {
baseDir: "./"
},
files: [
// Patterns for static files to watch
"./demo/src/**.*",
"index.html",
"./dist/demo.js",
"./src/knockout-apollo.js"
],
browser: "firefox",
notify: false,
port: 3003,
open: "local",
reloadOnRestart: false
});
watch("./dist/demo.js").on('change', browserSync.reload);
watch("./demo/src/**.*").on('change', browserSync.reload);
watch("index.html").on('change', browserSync.reload);
};
exports.serve = series(serve);