summaryrefslogtreecommitdiffstats
path: root/gulpfile.js/tasks/preview-serve.js
blob: c9a9c255ce613102ea7b868f030b970e443bd1b9 (plain)
1
2
3
4
5
6
7
8
9
10
'use strict'

const connect = require('gulp-connect')

module.exports = (serveDir, opts = {}, watch = undefined) => (done) => {
  connect.server({ ...opts, root: serveDir }, function () {
    this.server.on('close', done)
    if (watch) watch()
  })
}