Skip to content

Commit

Permalink
chore(gulp): add cleanOutput command. Clean and build before watching
Browse files Browse the repository at this point in the history
  • Loading branch information
talha131 committed Dec 1, 2019
1 parent 50c21e1 commit 19af5e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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");

Expand Down Expand Up @@ -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;

0 comments on commit 19af5e3

Please sign in to comment.