Commit 2219755d authored by Dan Allen's avatar Dan Allen

rename previewServe task function to serve

parent 39efbaff
Pipeline #41700385 passed with stages
in 2 minutes and 25 seconds
......@@ -11,7 +11,7 @@ const srcDir = 'src'
const destDir = `${previewDestDir}/_`
const { reload: livereload } = process.env.LIVERELOAD === 'true' ? require('gulp-connect') : {}
const { remove, lintCss, lintJs, format, build, pack, previewPages, previewServe } = require('./tasks')
const { remove, lintCss, lintJs, format, build, pack, previewPages, serve } = require('./tasks')
const glob = {
all: [srcDir, previewSrcDir],
css: `${srcDir}/css/**/*.css`,
......@@ -84,7 +84,7 @@ const previewBuildTask = task({
const previewServeTask = task({
name: 'preview:serve',
call: previewServe(previewDestDir, { port: 5252, livereload }, () => watch(glob.all, previewBuildTask)),
call: serve(previewDestDir, { port: 5252, livereload }, () => watch(glob.all, previewBuildTask)),
})
const previewTask = task({
......
......@@ -2,8 +2,8 @@
const connect = require('gulp-connect')
module.exports = (serveDir, opts = {}, watch = undefined) => (done) => {
connect.server({ ...opts, root: serveDir }, function () {
module.exports = (root, opts = {}, watch = undefined) => (done) => {
connect.server({ ...opts, root }, function () {
this.server.on('close', done)
if (watch) watch()
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment