From 5fc1c9ee301d2df34093dac43731d4b1c6963680 Mon Sep 17 00:00:00 2001 From: marleyrae Date: Wed, 14 Jun 2023 20:11:17 -0700 Subject: [PATCH] root gulpfile that imports specific gulp files - for vercel --- gulpfile.js | 6 ++++++ package.json | 2 +- sues_virtual_life/gulpfile.js | 20 +++++++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 gulpfile.js diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..7966b7b --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,6 @@ +const {parallel} = require('gulp') + +const sues_virtual_life = require('./sues_virtual_life/gulpfile') +exports.sues_virtual_life = sues_virtual_life.watch + +exports.build = parallel(sues_virtual_life.build) diff --git a/package.json b/package.json index aab00a0..2338294 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "scripts": { - "dev": "browser-sync start --config bs-config.js" + "build": "gulp build" }, "devDependencies": { "browser-sync": "^2.29.3", diff --git a/sues_virtual_life/gulpfile.js b/sues_virtual_life/gulpfile.js index d6bad3a..c54995d 100644 --- a/sues_virtual_life/gulpfile.js +++ b/sues_virtual_life/gulpfile.js @@ -3,10 +3,13 @@ const posthtml = require('gulp-posthtml') const rename = require('gulp-rename') const browserSync = require('browser-sync').create() -const htmlFiles = ['./**/*.html', '!./**/index.html'] +const htmlFiles = [ + 'sues_virtual_life/**/*.html', + '!sues_virtual_life/**/index.html', +] function html() { - return src(htmlFiles) + const stream = src(htmlFiles) .pipe(posthtml([ require('posthtml-urls')({ eachURL: (url) => { @@ -21,13 +24,20 @@ function html() { .pipe(rename(path => { path.basename = 'index' })) - .pipe(dest('.')) - .pipe(browserSync.stream()) + .pipe(dest('sues_virtual_life')) + + if (browserSync.active) { + stream.pipe(browserSync.stream()) + } + + return stream } -exports.default = function () { +exports.watch = function () { browserSync.init(require('../bs-config')) watch(htmlFiles, {ignoreInitial: false}, html) watch('sues_virtual_life.css').on('change', browserSync.reload) } + +exports.build = html