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

rename previewServe task function to serve

parent 39efbaff
...@@ -11,7 +11,7 @@ const srcDir = 'src' ...@@ -11,7 +11,7 @@ const srcDir = 'src'
const destDir = `${previewDestDir}/_` const destDir = `${previewDestDir}/_`
const { reload: livereload } = process.env.LIVERELOAD === 'true' ? require('gulp-connect') : {} 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 = { const glob = {
all: [srcDir, previewSrcDir], all: [srcDir, previewSrcDir],
css: `${srcDir}/css/**/*.css`, css: `${srcDir}/css/**/*.css`,
...@@ -84,7 +84,7 @@ const previewBuildTask = task({ ...@@ -84,7 +84,7 @@ const previewBuildTask = task({
const previewServeTask = task({ const previewServeTask = task({
name: 'preview:serve', 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({ const previewTask = task({
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
const connect = require('gulp-connect') const connect = require('gulp-connect')
module.exports = (serveDir, opts = {}, watch = undefined) => (done) => { module.exports = (root, opts = {}, watch = undefined) => (done) => {
connect.server({ ...opts, root: serveDir }, function () { connect.server({ ...opts, root }, function () {
this.server.on('close', done) this.server.on('close', done)
if (watch) watch() 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