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`,
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({
+++ /dev/null
-'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()
- })
-}
--- /dev/null
+'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()
+ })
+}