From 19af5e3823f1856015940c83a2d7cd866fce8f03 Mon Sep 17 00:00:00 2001 From: Talha Mansoor Date: Sun, 1 Dec 2019 08:32:43 +0500 Subject: [PATCH] chore(gulp): add cleanOutput command. Clean and build before watching --- gulpfile.babel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 8db19d3f..63169098 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -1,6 +1,6 @@ import fs from "fs"; import path from "path"; -import { watch, parallel } from "gulp"; +import { watch, parallel, series } from "gulp"; import { exec } from "child_process"; import { create as browserSyncCreate } from "browser-sync"; const browserSync = browserSyncCreate(); @@ -9,6 +9,7 @@ const path404 = path.join(__dirname, "documentation/output/404.html"); const content_404 = () => fs.existsSync(path404) ? fs.readFileSync(path404) : null; +const cleanOutput = () => exec("cd documentation && rm -rf outout/"); const buildAll = () => exec("cd documentation && invoke build"); @@ -53,7 +54,7 @@ const watchFiles = () => { ); }; -const elegant = parallel(watchFiles, reload); +const elegant = series(cleanOutput, buildAll, parallel(watchFiles, reload)); exports.elegant = elegant; exports.default = elegant;