Refactor the build-task
This commit is contained in:
parent
ce34b2e9dc
commit
61627c2a6a
22
gulpfile.ts
22
gulpfile.ts
|
@ -193,6 +193,9 @@ function BrowserSync(filePath?: string): TaskFunction
|
||||||
* Builds the project.
|
* Builds the project.
|
||||||
*/
|
*/
|
||||||
export async function Build(): Promise<void>
|
export async function Build(): Promise<void>
|
||||||
|
{
|
||||||
|
return new Promise(
|
||||||
|
(resolve, reject) =>
|
||||||
{
|
{
|
||||||
if (settings.Watch)
|
if (settings.Watch)
|
||||||
{
|
{
|
||||||
|
@ -213,12 +216,19 @@ export async function Build(): Promise<void>
|
||||||
gulp.watch(settings.TemplateSource("**"), { usePolling: true }, gulp.series(Templates, BrowserSync()));
|
gulp.watch(settings.TemplateSource("**"), { usePolling: true }, gulp.series(Templates, BrowserSync()));
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all(
|
gulp.parallel(Library, Theme, Templates)(
|
||||||
[
|
(error) =>
|
||||||
Library(),
|
{
|
||||||
Theme(),
|
if (error)
|
||||||
Templates()
|
{
|
||||||
]);
|
reject(error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue