Fix console output of the Watch
task
This commit is contained in:
parent
4d07cfac76
commit
8369fa4949
20
gulpfile.ts
20
gulpfile.ts
|
@ -3,7 +3,7 @@ import GulpClient, { TaskFunction } from "gulp";
|
|||
import path from "upath";
|
||||
import { Context } from "./gulp/Context.js";
|
||||
|
||||
const { dest, parallel, series, src, watch } = GulpClient;
|
||||
const { dest, parallel, series, src, task, watch } = GulpClient;
|
||||
const { join } = path;
|
||||
|
||||
const context = new Context();
|
||||
|
@ -119,10 +119,21 @@ function BrowserSync(syncer: BrowserSyncInstance, filePath?: string): TaskFuncti
|
|||
/**
|
||||
* Builds and watches the files for changes.
|
||||
*/
|
||||
export function Watch(): void
|
||||
export let Watch: TaskFunction = async (): Promise<void> =>
|
||||
{
|
||||
return new Promise<void>(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
series(Build)(
|
||||
(error) =>
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
reject(error);
|
||||
}
|
||||
else
|
||||
{
|
||||
let syncer = browserSync.create();
|
||||
Build();
|
||||
|
||||
syncer.init({
|
||||
open: false,
|
||||
|
@ -153,4 +164,7 @@ export function Watch(): void
|
|||
series(
|
||||
WebPages,
|
||||
BrowserSync(syncer, "*.html")));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue