diff options
Diffstat (limited to 'gulpfile.js/tasks/preview-serve.js')
-rw-r--r-- | gulpfile.js/tasks/preview-serve.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gulpfile.js/tasks/preview-serve.js b/gulpfile.js/tasks/preview-serve.js index 8ae70cf..c9a9c25 100644 --- a/gulpfile.js/tasks/preview-serve.js +++ b/gulpfile.js/tasks/preview-serve.js @@ -1,14 +1,10 @@ 'use strict' const connect = require('gulp-connect') -const { watch } = require('gulp') -module.exports = (serveDir, opts = {}) => (done) => { - const { glob: watchGlob, call: watchCall } = opts.watch || {} - opts = { ...opts, root: serveDir } - delete opts.watch - connect.server(opts, function () { +module.exports = (serveDir, opts = {}, watch = undefined) => (done) => { + connect.server({ ...opts, root: serveDir }, function () { this.server.on('close', done) - if (watchGlob && watchCall) watch(watchGlob, watchCall) + if (watch) watch() }) } |