Refactor the build-task
This commit is contained in:
parent
ce34b2e9dc
commit
61627c2a6a
56
gulpfile.ts
56
gulpfile.ts
|
@ -194,31 +194,41 @@ function BrowserSync(filePath?: string): TaskFunction
|
|||
*/
|
||||
export async function Build(): Promise<void>
|
||||
{
|
||||
if (settings.Watch)
|
||||
{
|
||||
log.info(watchStartMessage);
|
||||
return new Promise(
|
||||
(resolve, reject) =>
|
||||
{
|
||||
if (settings.Watch)
|
||||
{
|
||||
log.info(watchStartMessage);
|
||||
|
||||
syncer.init({
|
||||
open: false,
|
||||
proxy: "http://localhost",
|
||||
port: 3000,
|
||||
ui: {
|
||||
port: 3001
|
||||
},
|
||||
ghostMode: false,
|
||||
online: false
|
||||
syncer.init({
|
||||
open: false,
|
||||
proxy: "http://localhost",
|
||||
port: 3000,
|
||||
ui: {
|
||||
port: 3001
|
||||
},
|
||||
ghostMode: false,
|
||||
online: false
|
||||
});
|
||||
|
||||
gulp.watch(settings.ThemeSource("**"), { usePolling: true }, gulp.series(Theme, BrowserSync("*.css")));
|
||||
gulp.watch(settings.TemplateSource("**"), { usePolling: true }, gulp.series(Templates, BrowserSync()));
|
||||
}
|
||||
|
||||
gulp.parallel(Library, Theme, Templates)(
|
||||
(error) =>
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
reject(error);
|
||||
}
|
||||
else
|
||||
{
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
gulp.watch(settings.ThemeSource("**"), { usePolling: true }, gulp.series(Theme, BrowserSync("*.css")));
|
||||
gulp.watch(settings.TemplateSource("**"), { usePolling: true }, gulp.series(Templates, BrowserSync()));
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
[
|
||||
Library(),
|
||||
Theme(),
|
||||
Templates()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue