rename previewServe task function to serve
authorDan Allen <dan@opendevise.com>
Sun, 30 Dec 2018 21:05:46 +0000 (14:05 -0700)
committerDan Allen <dan@opendevise.com>
Sun, 30 Dec 2018 21:05:46 +0000 (14:05 -0700)
gulpfile.js/index.js
gulpfile.js/tasks/preview-serve.js [deleted file]
gulpfile.js/tasks/serve.js [new file with mode: 0644]

index c9f01b8..cf95f35 100644 (file)
@@ -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({
diff --git a/gulpfile.js/tasks/preview-serve.js b/gulpfile.js/tasks/preview-serve.js
deleted file mode 100644 (file)
index c9a9c25..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-'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()
-  })
-}
diff --git a/gulpfile.js/tasks/serve.js b/gulpfile.js/tasks/serve.js
new file mode 100644 (file)
index 0000000..82ee933
--- /dev/null
@@ -0,0 +1,10 @@
+'use strict'
+
+const connect = require('gulp-connect')
+
+module.exports = (root, opts = {}, watch = undefined) => (done) => {
+  connect.server({ ...opts, root }, function () {
+    this.server.on('close', done)
+    if (watch) watch()
+  })
+}